File tree Expand file tree Collapse file tree 1 file changed +0
-8
lines changed Expand file tree Collapse file tree 1 file changed +0
-8
lines changed Original file line number Diff line number Diff line change 22
22
is_list_like ,
23
23
is_object_dtype ,
24
24
is_scalar ,
25
- needs_i8_conversion ,
26
25
)
27
26
from pandas .core .dtypes .generic import ABCDataFrame , ABCIndexClass , ABCSeries
28
27
from pandas .core .dtypes .missing import isna
@@ -656,13 +655,6 @@ def item(self):
656
655
ValueError
657
656
If the data is not length-1.
658
657
"""
659
- if not (
660
- is_extension_array_dtype (self .dtype ) or needs_i8_conversion (self .dtype )
661
- ):
662
- # numpy returns ints instead of datetime64/timedelta64 objects,
663
- # which we need to wrap in Timestamp/Timedelta/Period regardless.
664
- return self ._values .item ()
665
-
666
658
if len (self ) == 1 :
667
659
return next (iter (self ))
668
660
raise ValueError ("can only convert an array of size 1 to a Python scalar" )
You can’t perform that action at this time.
0 commit comments