Skip to content

.describe() doesn't give expected output instead gives nan #144

@ninjakx

Description

@ninjakx

Expected output (using pandas):

bill_length_mm bill_depth_mm flipper_length_mm body_mass_g year
count 342.000000 342.000000 342.000000 342.000000 344.000000
mean 43.921930 17.151170 200.915205 4201.754386 2008.029070
std 5.459584 1.974793 14.061714 801.954536 0.818356
min 32.100000 13.100000 172.000000 2700.000000 2007.000000
25% 39.225000 15.600000 190.000000 3550.000000 2007.000000
50% 44.450000 17.300000 197.000000 4050.000000 2008.000000
75% 48.500000 18.700000 213.000000 4750.000000 2009.000000
max 59.600000 21.500000 231.000000 6300.000000 2009.000000

Danfo.js is giving me:

bill_length_mm bill_depth_mm flipper_length_mm body_mass_g year
count 342 342 342 342 344
mean 43.921928 17.151169 200.915207 4201.754395 2008.028809
std NaN NaN NaN NaN 0.818356
min 32.099998 13.1 172 2700 2007
median 44.45 18 202 4387.5 2008
max 59.599998 21.5 231 6300 2009
variance NaN NaN NaN NaN 0.669706
max 59.600000 21.500000 231.000000 6300.000000 2009.000000

Even median and 50% have some difference.

You can run the same csv here:
https://observablehq.com/@visnup/hello-danfo-js

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions