Skip to content

Commit 947f252

Browse files
committed
fix: convert bool to np.uint8 in _to_numpy_array
This fixes #409
1 parent ab8de2d commit 947f252

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

proplot/internals/inputs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ def _to_numpy_array(data, strip_units=False):
130130
data = data.data # support pint quantities that get unit-stripped later
131131
elif isinstance(data, (DataFrame, Series, Index)):
132132
data = data.values
133+
if data.dtype == bool:
134+
data = data.view(np.uint8)
133135
if Quantity is not ndarray and isinstance(data, Quantity):
134136
if strip_units:
135137
return np.atleast_1d(data.magnitude)

0 commit comments

Comments
 (0)