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

Initialization of Woodwork DataTable using pandas DataFrame and then numpy array causes different behavior from just initalization using numpy array. #481

Open
angela97lin opened this issue Jan 7, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@angela97lin
Copy link

angela97lin commented Jan 7, 2021

If I initialize a Woodwork DataTable using a pandas DataFrame and then initialize another Woodwork DataTable using the numpy array underneath, it creates a Woodwork DataTable with category types. However, skipping the first step creates a Woodwork DataTable of ints/floats.

Printing out the underlying numpy array, it looks like the numpy array gets converted s.t. it has a dtype=object, causing Woodwork to convert to category types, but this behavior is confusing / inconsistent.

image

image

Code Sample, a copy-pastable example to reproduce your bug.

import woodwork as ww
import pandas as pd
X = pd.DataFrame([[1, 0]])
ww.DataTable(X)
ww.DataTable(X.to_numpy())

vs

import woodwork as ww
import pandas as pd
X = pd.DataFrame([[1, 0]])
# ww.DataTable(X)
ww.DataTable(X.to_numpy())
@angela97lin angela97lin added the bug Something isn't working label Jan 7, 2021
@tyler3991
Copy link

Let's revisit this after the accessor change.

@tyler3991
Copy link

When we address this one, also keep an eye on #456

@gsheni
Copy link
Contributor

gsheni commented Nov 2, 2021

@angela97lin Is this still a problem or can we close?

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

3 participants