Fix deprecated np.unicode type (#2035)

Until numpy version 1.20.0, numpy.unicode was an alias for str in python3. In 1.20.0, it's fully deprecated and is an int. This is bad and breaks things. This commit drops the np.unicode alias and just uses str, as is advised here:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
This commit is contained in:
Marcus Kinsella
2021-02-03 09:22:27 -08:00
committed by GitHub
parent 90a4ff7526
commit 3c0b1d45db
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ def get_dtype_from_dtype(dtype, array_values=None):
if dtype_name == "bool":
return np.uint8
if dtype_name == "object" and dtype_kind == "O":
return np.unicode
return str
if dtype_name == "category":
return get_dtype_from_dtype(dtype.categories.dtype, array_values)