@@ -10,10 +10,13 @@ cnp.import_array()
10
10
11
11
cimport pandas._libs.util as util
12
12
13
- from pandas._libs.tslibs.np_datetime cimport (
14
- get_timedelta64_value, get_datetime64_value)
13
+
14
+ from pandas._libs.tslibs.np_datetime cimport get_datetime64_value, get_timedelta64_value
15
15
from pandas._libs.tslibs.nattype cimport (
16
- checknull_with_nat, c_NaT as NaT, is_null_datetimelike)
16
+ c_NaT as NaT,
17
+ checknull_with_nat,
18
+ is_null_datetimelike,
19
+ )
17
20
from pandas._libs.ops_dispatch import maybe_dispatch_ufunc_to_dunder_op
18
21
19
22
from pandas.compat import is_platform_32bit
@@ -44,7 +47,7 @@ cpdef bint checknull(object val):
44
47
45
48
Returns
46
49
-------
47
- result : bool
50
+ bool
48
51
49
52
Notes
50
53
-----
@@ -223,7 +226,7 @@ def isnaobj2d_old(arr: ndarray) -> ndarray:
223
226
224
227
Returns
225
228
-------
226
- result : ndarray (dtype = np.bool_)
229
+ ndarray (dtype = np.bool_)
227
230
228
231
Notes
229
232
-----
@@ -248,17 +251,11 @@ def isnaobj2d_old(arr: ndarray) -> ndarray:
248
251
249
252
250
253
def isposinf_scalar (val: object ) -> bool:
251
- if util.is_float_object(val ) and val == INF:
252
- return True
253
- else:
254
- return False
254
+ return util.is_float_object(val ) and val == INF
255
255
256
256
257
257
def isneginf_scalar(val: object ) -> bool:
258
- if util.is_float_object(val ) and val == NEGINF:
259
- return True
260
- else:
261
- return False
258
+ return util.is_float_object(val ) and val == NEGINF
262
259
263
260
264
261
cdef inline bint is_null_datetime64(v ):
@@ -426,7 +423,6 @@ class NAType(C_NAType):
426
423
return NA
427
424
elif isinstance (other, np.ndarray):
428
425
return np.where(other == 1 , other, NA)
429
-
430
426
return NotImplemented
431
427
432
428
# Logical ops using Kleene logic
@@ -436,8 +432,7 @@ class NAType(C_NAType):
436
432
return False
437
433
elif other is True or other is C_NA:
438
434
return NA
439
- else :
440
- return NotImplemented
435
+ return NotImplemented
441
436
442
437
__rand__ = __and__
443
438
@@ -446,8 +441,7 @@ class NAType(C_NAType):
446
441
return True
447
442
elif other is False or other is C_NA:
448
443
return NA
449
- else :
450
- return NotImplemented
444
+ return NotImplemented
451
445
452
446
__ror__ = __or__
453
447
0 commit comments