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

DataFrame.apply passes empty row to callback when the cell has objects as values #467

Closed
applegrew opened this issue Jul 6, 2022 · 1 comment

Comments

@applegrew
Copy link

applegrew commented Jul 6, 2022

Describe the bug
DataFrame.apply removes all values of type object. It seems to accept only string or numbers.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/summer-forest-xzq2rq?file=/src/index.js
  2. Open the console.

Expected behavior
The callback should be called with non-zero length array.

Danfojs version:

  • 1.1.1 (browser)

Additional context
This happens since apply internally removes all values which are "empty". However, the "empty" logic is weird (

return value === undefined || value === null || (isNaN(value as any) && typeof value !== "string");
) and it removes all values if they are not string or number. In my case I have JS objects which internally have data.

@applegrew applegrew changed the title DataFrame.apply passes empty row to callback even when the cell has values DataFrame.apply passes empty row to callback when the cell has objects as values Jul 6, 2022
@risenW
Copy link
Member

risenW commented Sep 25, 2022

  1. https://codesandbox.io/s/summer-forest-xzq2rq?file=/src/index.js

The issue is not the apply function, The problem is that you're creating a DataFrame from nested objects, which is not supported atm.

@risenW risenW closed this as completed Sep 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants