Skip to content

Commit 7a97fb7

Browse files
Update pint_array.py
Delete the last vestiges of some old code from a different PR. Also use Pandas public APIs for `infer_dtype` (used in `_from_factorized`). Signed-off-by: Michael Tiemann <[email protected]>
1 parent 053f903 commit 7a97fb7

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

pint_pandas/pint_array.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -320,11 +320,6 @@ def __setitem__(self, key, value):
320320
# doing nothing here seems to be ok
321321
return
322322

323-
try:
324-
next(i for i in self._data if pd.notna(i))
325-
except StopIteration:
326-
pass
327-
328323
if isinstance(value, _Quantity):
329324
value = value.to(self.units).magnitude
330325
elif is_list_like(value) and len(value) > 0:
@@ -557,7 +552,7 @@ def _from_sequence_of_strings(cls, scalars, dtype=None, copy=False):
557552

558553
@classmethod
559554
def _from_factorized(cls, values, original):
560-
from pandas._libs.lib import infer_dtype
555+
from pandas.api.types import infer_dtype
561556

562557
if infer_dtype(values) != "object":
563558
values = pd.array(values, copy=False)

0 commit comments

Comments
 (0)