accessing single cell value #172
Answered
by
risenW
spleshakov
asked this question in
Q&A
-
Hello, I was trying to find a way to access one particular cell value by specifying the column and the index. Is there a method that returns a cell's primitive value? Thank you |
Beta Was this translation helpful? Give feedback.
Answered by
risenW
Apr 21, 2021
Replies: 1 comment
-
@spleshakov add a let data = { "Name": ["Apples", "Mango", "Banana", "Pear"],
"Count": [21, 5, 30, 10],
"Price": [200, 300, 40, 250] }
let df = new dfd.DataFrame(data)
let sub_df = df.loc({rows: [0], columns: ["Name"]}).values
console.log(sub_df)
// [[Apples]] Kinda hacky: let sub_df = df.loc({rows: [0], columns: ["Name"]}).values[0][0]
console.log(sub_df)
// Apples |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
spleshakov
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@spleshakov add a
.values
to the end of your function. Although this returns an array of array, it's closer to what you want.We should support this internally. I'll raise an issue.
Kinda hacky: