Parquet Data - module 'numpy' has no attribute 'bool'
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello Community,
I am trying to load parquet data into Alteryx (code below) - it all works well, till the point I want to write data into Alteryx (two last rows). Immediately, as I want to wrote output I am getting error:
module 'numpy' has no attribute 'bool'
from ayx import Alteryx
import pandas as pd
file = "C:/Users/nikolnor/Downloads/userdata4.parquet"
df = pd.read_parquet(file)
Alteryx.write(df,1)
#Alteryx.write(pd.read_parquet(par_file) ,1)
Could someone advise?
Thank you,
Nikoleta
- Labels:
- Python
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@Nikoleta I think @Aguisande and @JarrodT discussed this recently and it was an issue with numpy being updated past the version that alteryx ships with. I'm not sure what version of alteryx you have, but their suggestion was to revert numpy back to 1.19.1: Package.installPackages(['numpy==1.19.1']).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@patrick_digan is correct, when the package is updated, the new declaration should be just bool (not np.bool as it used to be).
Reverting the package to the one mentioned is the best an offical method for getting rid of the error.
Also, not supported, not recommneded, but I did change line 571 in C:\Program Files\Alteryx\bin\Miniconda3\envs\DesignerBaseTools_vEnv\Lib\site-packages\ayx\Datafiles.py and worked too, allowing me to keep the updated numpy package operational.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks @Aguisande I just did your "not recommended" solution and it worked! ...would recommend.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi! I tried reverting back to 1.19 and received the following error after trying to run from ayx import Alteryx: Import Error - this version of pandas is incompatible with numpy < 1.20.3.
Were you able to resolve this error on your end and get back to using 1.19?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I also facing the same issue. Even while importing Linear Regression model from sklearn getting a same attribute error. I also reverted to previous numpy version 1.19.1 but no changes on the error same issue existing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I was facing a similar issue and this works, convert the bool column to string before use the Alteryx write line:
df = pd.DataFrame(items)
df[df.select_dtypes(exclude=['number']).columns] = df.select_dtypes(exclude=['number']).astype(str)
Alteryx.write(df, 1)
