danfojs icon indicating copy to clipboard operation
danfojs copied to clipboard

Error: DtypeError: Dtype "undefined" not supported

Open coco-super opened this issue 2 years ago • 1 comments

file.csv

  import { readCSV } from 'danfojs-node';

  const ndf = await readCSV('/Users/ellison/Desktop/file.csv');
  ndf.print();
  ndf.loc({ rows: [1], columns: ['Variable 1'] }).print(); // error

image

coco-super avatar Jan 04 '23 14:01 coco-super

  import { readCSV } from 'danfojs-node';
  const ndf = await readCSV('/Users/ellison/Desktop/file.csv');

  console.log(ndf.columns[0].charAt(0)); // print: empty string
  console.log(ndf.columns[0].charAt(1)); // print: "V"

@risenW The results from ndf.columns contain spaces in front of each item, which is the root cause of this problem.(There are no spaces in the contents of the original csv file)

coco-super avatar Jan 05 '23 08:01 coco-super