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

Weird behavior of iloc function #265

Closed
db1981 opened this issue Aug 5, 2021 · 1 comment
Closed

Weird behavior of iloc function #265

db1981 opened this issue Aug 5, 2021 · 1 comment

Comments

@db1981
Copy link

db1981 commented Aug 5, 2021

Hello everyone,
I'm experiencing what I believe is a bug, but since I'm a Javascript newbie, it could be me...

I'm trying to pull out row by row from a dataframe, after having populated it from a CSV:

dfd.read_csv('http://localhost:8000/claroty_ngrams.csv')
        .then(df => {
            var test = df.iloc({rows: [1], columns: [1]})
            test.print()
        }).catch(err => {
            console.log(err);
        });

This is returning a weird error:

TypeError: t.columns[0].includes is not a function

The df DataFrame has 144 rows and 5 columns...

The suggested solution from #175:

let sub_df = df.iloc({ rows: [":1"], columns: [":1"] })

Triggers the following error:

Column length mismatch. You provided a column of length 1 but data has length of 3

Thanks!

@db1981 db1981 closed this as completed Aug 5, 2021
@db1981 db1981 changed the title Weird behavior of loc function Weird behavior of iloc function Aug 5, 2021
@db1981 db1981 reopened this Aug 5, 2021
@risenW
Copy link
Member

risenW commented Aug 27, 2021

@db1981 Sorry for the late reply. The problem is the file path you passed to read_csv. The file path should be absolute or relative paths, not URLs.

@risenW risenW closed this as completed Aug 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants