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

mismatch between ctypes an values types #581

Open
spleshakov opened this issue May 31, 2023 · 0 comments
Open

mismatch between ctypes an values types #581

spleshakov opened this issue May 31, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@spleshakov
Copy link

spleshakov commented May 31, 2023

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

@risenW risenW added the bug Something isn't working label Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants