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

Issue with Retrieving Columns Named with Colon ':' in Single Selection Using danfojs-node #639

Open
idobarlev2 opened this issue Apr 17, 2024 · 0 comments

Comments

@idobarlev2
Copy link

Describe the bug
In danfojs-node, when attempting to retrieve data from a DataFrame based on a single column name that contains a colon (':'), the operation fails with a ColumnIndexError. However, retrieving multiple columns where each includes a colon in their names does not produce this error.

To Reproduce
Steps to reproduce the behavior:

Import DataFrame from danfojs-node.
Create a DataFrame and attempt to access a single column with a colon in its name using the .loc() method.
Observe the ColumnIndexError.

Expected behavior
The .loc() method should consistently handle column names with colons, whether accessing a single column or multiple columns.

Code Snippets
Here is the code snippet that produces the error:

import { DataFrame } from "danfojs-node";
// Assuming myDF is already defined and contains the necessary columns
let myDF: DataFrame;
myDF.loc({ columns: ['my : column'] })  // This triggers an error

Error message received:

ColumnIndexError: Invalid row split parameter. If using a row split string, it must be of the form; rows: ["start:end"]

However, the following code works without any issues:

import { DataFrame } from "danfojs-node";
// Assuming myDF is already defined and contains the necessary columns
let myDF: DataFrame;
myDF.loc({ columns: ['my : column', 'my : other : column'] })  // This works fine

Environment:
danfojs-node version: ^1.1.2
Node.js version: v18.13.0

Additional context
The error suggests there may be an issue with how the .loc() method parses the column names when there is only a single column with special characters like a colon.

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

1 participant