Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
SOLVED

TypeError: No registered converter was able to extract a C++ pointer to type char

8 - Asteroid

Hi all,

i'm getting an error while running the py tool, although this works in PyCharm.

"TypeError: No registered converter was able to extract a C++ pointer to type char from this Python object of type Container"

The result is a dataframe, although it throws that error. The goal of the script outputs the data from the excel tabs with few other columns (records that are highlighted in a color (which represent totals) and from which tab). For this i'm using StyleFrame.

Attached you can find the file, the workflow and the log.
You just need to update the file path in the .yxmd.

 

Thank you,
Regards,


Alteryx
Alteryx

Hi @jcardoso 

 

Could you try installing the dlib package using the Python tool in Alteryx?

 

Thanks!

Tessa Smithers

Customer Support Engineer – KCS Coach
Alteryx, Inc.


8 - Asteroid

HI @TessaS , Thank you for your reply!

I did 


Alteryx.installPackage("CMake")
Alteryx.installPackage("dlib")

as it was asking for the installation of CMake, so i did, and it installed the dlib package as print attached, although in the end it through the result attached, and didn't let the output to be performed

so, the error appeared again,
Thank you so much.


Alteryx
Alteryx

Hi @jcardoso 

 

Thank you for trying that. Would you be able to email support@alteryx.com so we could investigate the issue thoroughly?

 

Thanks!

 

Tessa Smithers

Customer Support Engineer – KCS Coach
Alteryx, Inc.


Alteryx
Alteryx

Hi @jcardoso,

 

Let me share the reply of our Python experts.

 

The issue lies with the data frame created from the StyleFrame library.

 

sf = StyleFrame.read_excel(excel_file_path, sheet_name=sheet_name, read_style=True, use_openpyxl_styles=False, skiprows=3)

 

Under the hood, the columns names are actually a 'Styleframe container', which the ayx package doesn't support: 

 

sf.data_df.columns[0]
<styleframe.container.Container at 0x22c8e75eb70>

 

The workaround is to rename the columns in sf to normal strings (my spacing may be off. Feel free to give cols different names)

 

new_col = []
for i, col in enumerate((sf.data_df.columns)):
    new_col.append(str(i))
sf.data_df.columns=new_col
# get the hex code for each record
sf_color = sf.applymap(convert_to_color_hex)

 

 

Fixing the columns, the workflow runs:

 
 

AndrewKramer_0-1594397166020.png

 

Fixed Jupyter Cell:

 

AndrewKramer_1-1594397182884.png

 

 Thanks!

Michael Adler
Sr. Customer Support Engineer -- Knowledge Management Coach
Alteryx, Inc.

8 - Asteroid

Hi @MichaelAd,

thank you for coming back to this! Yes, it does indeed sort it!

Although had to change the df as below after the column name change.


'value'
: sf[sf.data_df.columns[1]].values

Thank you so much for this,
Regards,

Labels