Skip to content

accessing single cell value #172

Answered by risenW
spleshakov asked this question in Q&A
Discussion options

You must be logged in to vote

@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.

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

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by spleshakov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants