File tree 4 files changed +7
-24
lines changed
4 files changed +7
-24
lines changed Original file line number Diff line number Diff line change @@ -439,12 +439,6 @@ def __init__(
439
439
"explicitly specify the categories order "
440
440
"by passing in a categories argument."
441
441
) from err
442
- except ValueError as err :
443
-
444
- # TODO(EA2D)
445
- raise NotImplementedError (
446
- "> 1 ndim Categorical are not supported at this time"
447
- ) from err
448
442
449
443
# we're inferring from values
450
444
dtype = CategoricalDtype (categories , dtype .ordered )
Original file line number Diff line number Diff line change @@ -142,11 +142,8 @@ def is_bool_indexer(key: Any) -> bool:
142
142
elif is_bool_dtype (key .dtype ):
143
143
return True
144
144
elif isinstance (key , list ):
145
- try :
146
- arr = np .asarray (key )
147
- return arr .dtype == np .bool_ and len (arr ) == len (key )
148
- except TypeError : # pragma: no cover
149
- return False
145
+ arr = np .asarray (key )
146
+ return arr .dtype == np .bool_ and len (arr ) == len (key )
150
147
151
148
return False
152
149
Original file line number Diff line number Diff line change 17
17
import numpy .ma as ma
18
18
19
19
from pandas ._libs import lib
20
- from pandas ._libs .tslibs import IncompatibleFrequency
21
20
from pandas ._typing import (
22
21
AnyArrayLike ,
23
22
ArrayLike ,
@@ -289,9 +288,9 @@ def array(
289
288
IntegerArray ,
290
289
IntervalArray ,
291
290
PandasArray ,
291
+ PeriodArray ,
292
292
StringArray ,
293
293
TimedeltaArray ,
294
- period_array ,
295
294
)
296
295
297
296
if lib .is_scalar (data ):
@@ -315,12 +314,8 @@ def array(
315
314
if dtype is None :
316
315
inferred_dtype = lib .infer_dtype (data , skipna = True )
317
316
if inferred_dtype == "period" :
318
- try :
319
- return period_array (data , copy = copy )
320
- except IncompatibleFrequency :
321
- # We may have a mixture of frequencies.
322
- # We choose to return an ndarray, rather than raising.
323
- pass
317
+ return PeriodArray ._from_sequence (data , copy = copy )
318
+
324
319
elif inferred_dtype == "interval" :
325
320
try :
326
321
return IntervalArray (data , copy = copy )
Original file line number Diff line number Diff line change @@ -6468,11 +6468,8 @@ def _maybe_cast_data_without_dtype(subarr: np.ndarray) -> ArrayLike:
6468
6468
tda = TimedeltaArray ._from_sequence (subarr , copy = False )
6469
6469
return tda
6470
6470
elif inferred == "period" :
6471
- try :
6472
- parr = PeriodArray ._from_sequence (subarr )
6473
- return parr
6474
- except IncompatibleFrequency :
6475
- pass
6471
+ parr = PeriodArray ._from_sequence (subarr )
6472
+ return parr
6476
6473
6477
6474
return subarr
6478
6475
You can’t perform that action at this time.
0 commit comments