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

BUG:TypeError: Cannot interpret 'CategoricalDtype(categories=['no', 'yes'], ordered=False)' as a data type #1692

Open
sureshchepuri opened this issue Oct 21, 2020 · 0 comments

Comments

@sureshchepuri
Copy link

I just upgraded all my python libraries, and now my previous code is started to fail.
I'm using blaze with pandas. Here is my method code

blaze.data(res)

res contains below data

             col1         age  ...                                           col31  year
0            yes    55-64  ...                                             NaN  2011
1             no    25-34  ...                                             NaN  2011
2             no    55-64  ...                                             NaN  2011

I'm using below dependencies

- python=3.6.11=h4d41432_2_cpython
- blaze=0.11.3=py36h4e06776_0
- odo=0.5.1=py36h90ed295_0
- pandas=1.0.5=py36h0573a6f_0
- numpy=1.19.1=py36h3849536_2

I'm getting the following error

  File "cytoolz/functoolz.pyx", line 667, in cytoolz.functoolz.pipe
  File "cytoolz/functoolz.pyx", line 642, in cytoolz.functoolz.c_pipe
  File "/home/ubuntu/miniconda/envs/my_env/lib/python3.6/site-packages/blaze/interactive.py", line 153, in data
    dshape = discover(data_source)
  File "/home/ubuntu/miniconda/envs/my_env/lib/python3.6/site-packages/multipledispatch/dispatcher.py", line 278, in __call__
    return func(*args, **kwargs)
  File "/home/ubuntu/miniconda/envs/my_env/lib/python3.6/site-packages/odo/backends/pandas.py", line 31, in discover_dataframe
    for k in df.columns])
  File "/home/ubuntu/miniconda/envs/my_env/lib/python3.6/site-packages/odo/backends/pandas.py", line 31, in <listcomp>
    for k in df.columns])
  File "/home/ubuntu/miniconda/envs/my_env/lib/python3.6/site-packages/odo/backends/pandas.py", line 23, in dshape_from_pandas
    dshape = datashape.CType.from_numpy_dtype(col.dtype)
  File "/home/ubuntu/miniconda/envs/my_env/lib/python3.6/site-packages/datashape/coretypes.py", line 779, in from_numpy_dtype
    if np.issubdtype(dt, np.datetime64):
  File "/home/ubuntu/miniconda/envs/my_env/lib/python3.6/site-packages/numpy/core/numerictypes.py", line 388, in issubdtype
    arg1 = dtype(arg1).type
TypeError: Cannot interpret 'CategoricalDtype(categories=['no', 'yes'], ordered=False)' as a data type

It's failing to parse second column values.

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

1 participant