Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iloc should support accessing single values #175

Closed
risenW opened this issue Apr 21, 2021 · 2 comments
Closed

iloc should support accessing single values #175

risenW opened this issue Apr 21, 2021 · 2 comments
Labels
good first issue Good for newcomers

Comments

@risenW
Copy link
Member

risenW commented Apr 21, 2021

If i run the following:

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.iloc({rows: [0], columns: [0]})
sub_df.print()

I should get the correct result not the following error:

TypeError: t.columns[0].includes is not a function
@risenW risenW added the good first issue Good for newcomers label Apr 21, 2021
@jtwigg
Copy link

jtwigg commented Apr 28, 2021

+1 agreed.
I struggled to figure out how to get random access working with this library. I could only perform values[0] which is probably very slow to construct an array.

@risenW
Copy link
Member Author

risenW commented May 30, 2021

Closing this for now: Can achieve this with the following code:

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.iloc({ rows: [":1"], columns: [":1"] })
sub_df.print()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants