You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
The text was updated successfully, but these errors were encountered:
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:
Error message received:
However, the following code works without any issues:
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.
The text was updated successfully, but these errors were encountered: