-
-
Notifications
You must be signed in to change notification settings - Fork 214
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
Values mapped to incorrect columns #556
Comments
Nb. If fields are not defined in the first object
They will be dropped:
Including all fields in the first object
Does result in all keys being in the output data (but still incorrectly mapped):
The above both fail with .print() called on the df "Table must have a consistent number of cells." |
I am facing the same issue as @febilyt. Are there any intermediate solutions to this other than fixing the ordering of the data array up front? |
I wondered if a new DataFrame could be created & then have rows & columns dynamically added but I ran into a few issues with addColumn/append:
Cobbled together a quick solution based on farming the unique keys:
I've not used danfojs yet so I'm not quite sure how well the undefined will be handled however the above does get the data loaded as expected:
|
Describe the bug
When creating a dataframe from an object array, if the keys of different objects are not in the same order, the values will be mapped to an incorrect column.
To Reproduce
Sample code
Output:
Expected behavior
Value should be mapped to correct column depending on the object key.
The text was updated successfully, but these errors were encountered: