Using scipy's entropy function with "string" dtype #32234
Labels
Bug
Compat
pandas objects compatability with Numpy or Python functions
ExtensionArray
Extending pandas with custom dtypes or arrays.
Strings
String extension data type and string data
Hello,
I calculate entropies of real valued random variables thanks to
pandas
andscipy.stats
. For some practical reason, I bin my df's values withpd.cut
and thelabels
I assign to these binned valued has to be a string. I wanted to use the new "string" dtype introduced in 1.0.0, but there seems to be an issue, here is a code sample :The error raised is
TypeError: ufunc 'entr' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
The text was updated successfully, but these errors were encountered: