alteryx / alteryx/woodwork

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

Aperta
#481 3 commenti 1 reazione 0 assegnatari Vedi su GitHub
bug
Lingua principale
Python
Stelle
155
Fork
24
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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](https://user-images.githubusercontent.com/5422235/103842750-931c7700-5064-11eb-92ae-81297b4f72a3.png)

![image](https://user-images.githubusercontent.com/5422235/103842708-84ce5b00-5064-11eb-8b05-ab6735f678ea.png)

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

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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.