question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

not be able to query data after reading from csv

See original GitHub issue

I am reading data from a csv file. I want to query data with a very simple statement:

dfd.read_csv(dataPath)
.then(df => {
  let query_df = df.query({ column: "A", is: "==", to: "foo"});
  query_df.print();
})

it gives me this error: ReferenceError: bar is not defined and “bar” is one of the values in column “A”

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
JhennerTigreroscommented, Sep 10, 2020

I open a pull request with the fix 😃

1reaction
JhennerTigreroscommented, Sep 10, 2020

Yes, the problem is in eval function that is used in frame.js

if (eval(`${elem}${operator}${value}`)) {
  new_data.push(data_value);
  new_index.push(index[i]);
}

becase eval function resolve the string to NG==NG and the engine try to get the variable NG that doesn’t exits, I fix this changing the snippet code to

if (eval(`elem${operator}value`)) {
  new_data.push(data_value);
  new_index.push(index[i]);
}

and get the correct output

image

change it locally while fixing on main branch, the file is in /danfojs-node/dist/core/frame.js

Read more comments on GitHub >

github_iconTop Results From Across the Web

5 Magic Fixes for the Most Common CSV File reader Problems
Sometimes a file looks fine, but doesn't load. It could contain non-printable ASCII characters that usually don't belong in CSV files. It can ......
Read more >
Power Query - How to import a CSV file that does not match ...
Power Query - How to import a CSV file that does not match your locale settings. A CSV file does not contain any...
Read more >
Google Big Query - loading a csv file - Error while reading table
I've been able to replicate the error. In my case it appears when trying to load the CSV to BigQuery. The CSV has...
Read more >
Importing and Working with CSV Files in SQL Server
Here, we'll see how we can import CSV data into SQL server using SSMS, ... SQL queries on CSV files, which is not...
Read more >
Converting CSV to Excel: solutions for common issues - Ablebits
When opening a csv file in Excel, all data appears in a single column. ... For Excel to be able to read CSV...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found