You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now np.append will convert both operands to an array first, then combine the result. This produces suboptimal results for stringdtype and a scalar operand:
Pdb) np.append(stringdtype_array, "hello")
*** ValueError: Cannot find common instance for unequal dtype instances
If instead we cast the second argument to the dtype of the first argument, this would succeed.
Note that this problem is particular to StringDType, but relying on numpy coercing the arguments to built-in dtypes is probably less forward looking than casting to the dtype of the first argument.
The text was updated successfully, but these errors were encountered:
Proposed new feature or change:
Right now
np.append
will convert both operands to an array first, then combine the result. This produces suboptimal results for stringdtype and a scalar operand:If instead we cast the second argument to the dtype of the first argument, this would succeed.
Note that this problem is particular to
StringDType
, but relying on numpy coercing the arguments to built-in dtypes is probably less forward looking than casting to the dtype of the first argument.The text was updated successfully, but these errors were encountered: