@@ -162,21 +162,30 @@ def __invert__(self):
162
162
)
163
163
164
164
def __or__ (self , other ):
165
- return np .array (
166
- self , copy = False ).__or__ (np .array (other , copy = False ))
165
+ return type ( self ). from_scalars ( np .array (
166
+ self , copy = False ).__or__ (np .array (other , copy = False )))
167
167
168
168
def __ior__ (self , other ):
169
- return np .array (self , copy = False ) | np .array (other , copy = False )
169
+ return type (self ).from_scalars (
170
+ np .array (self , copy = False ) | np .array (other , copy = False ))
170
171
171
172
def __and__ (self , other ):
172
- return np .array (self , copy = False ).__and__ (np .array (other , copy = False ))
173
+ return type (self ).from_scalars (
174
+ np .array (self , copy = False ).__and__ (np .array (other , copy = False )))
173
175
174
176
def __iand__ (self , other ):
175
- return np .array (self , copy = False ) & (np .array (other , copy = False ))
177
+ return type (self ).from_scalars (
178
+ np .array (self , copy = False ) & (np .array (other , copy = False )))
176
179
177
180
def __array__ (self , dtype = None ):
178
181
return np .array (self ._data , copy = False )
179
182
183
+ def any (self , axis = 0 , out = None ):
184
+ return self ._data .to_pandas ().any ()
185
+
186
+ def all (self , axis = 0 , out = None ):
187
+ return self ._data .to_pandas ().all ()
188
+
180
189
def _reduce (self , method , skipna = True , ** kwargs ):
181
190
if skipna :
182
191
arr = self [~ self .isna ()]
@@ -188,9 +197,3 @@ def _reduce(self, method, skipna=True, **kwargs):
188
197
except AttributeError :
189
198
raise TypeError
190
199
return op (** kwargs )
191
-
192
- def any (self , axis = 0 , out = None ):
193
- return self ._data .to_pandas ().any ()
194
-
195
- def all (self , axis = 0 , out = None ):
196
- return self ._data .to_pandas ().all ()
0 commit comments