javascriptdata/danfojs

mismatch between ctypes an values types

spleshakov opened this issue · 0 comments

I have this code snippet

const danfojs = require("danfojs-node");

(async () => {
	let data = await danfojs.readCSV(
		`${__dirname}/plan.csv`,
		{
			dynamicTyping: {
				"variation": false
			}
		}
	)

	console.log(
		data.columns.map((item, index) => {
			return {
				[item]: data.ctypes.values[index]
			}
		})
	)
	console.log(
		data
			.column("variation")
			.unique()
			.values[0]
	)
	console.log(
		typeof data
			.column("variation")
			.unique()
			.values[0]
	)
})()

The output is

[
  ...
  { market_segment: 'string' },
  { variation: 'int32' },
  { '': 'int32' }
]
00
string

as you can see ctypes shows variation column has 'int32' value
however, all values in the column are strings: '00'

My expectation it ctype should also be a string to indicate actual value in the column

plan.csv