Skip to content

Commit

Permalink
Use np.strings instead of the deprecated np.char
Browse files Browse the repository at this point in the history
  • Loading branch information
otsaloma committed Dec 8, 2024
1 parent 192be0a commit 64946a5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dataiter/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def as_bytes(self):
>>> vector.as_bytes()
"""
if self.is_string():
array = np.char.encode(self, "utf-8")
array = np.strings.encode(self, "utf-8")
return array.view(self.__class__)
return self.astype(bytes)

Expand Down
2 changes: 1 addition & 1 deletion doc/dt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ dataiter.dt
===========

The ``dt`` module contains helper functions for dealing with vectors of
dates and datetimes, similar to ``numpy.char`` for vectors of strings.
dates and datetimes, similar to ``numpy.strings`` for vectors of strings.
Most of the operations are done via Python's standard library
``datetime`` module and subject to any limitations therein.

Expand Down
2 changes: 1 addition & 1 deletion validation/generate-df.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def read_csv(path):
if data[name].is_string():
# Use all lower case for strings to avoid differing
# sorting of lower vs. upper case characters.
data[name] = np.char.lower(data[name])
data[name] = np.strings.lower(data[name])
return data

# AGGREGATE
Expand Down

0 comments on commit 64946a5

Please sign in to comment.