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 2222 is_list_like ,
2323 is_object_dtype ,
2424 is_scalar ,
25- needs_i8_conversion ,
2625)
2726from pandas .core .dtypes .generic import ABCDataFrame , ABCIndexClass , ABCSeries
2827from pandas .core .dtypes .missing import isna
@@ -656,13 +655,6 @@ def item(self):
656655 ValueError
657656 If the data is not length-1.
658657 """
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-
666658 if len (self ) == 1 :
667659 return next (iter (self ))
668660 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