Skip to content

Commit 9d751b9

Browse files
committed
new lines using parentheses
1 parent 54cb25e commit 9d751b9

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

pandas/core/common.py

+12-14
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ def consensus_name_attr(objs):
7272

7373

7474
def maybe_box(indexer, values, obj, key):
75-
7675
# if we have multiples coming back, box em
7776
if isinstance(values, np.ndarray):
7877
return obj[indexer.get_loc(key)]
@@ -84,13 +83,13 @@ def maybe_box(indexer, values, obj, key):
8483
def maybe_box_datetimelike(value):
8584
# turn a datetime like into a Timestamp/timedelta as needed
8685

87-
if isinstance(value, (np.datetime64, datetime)) \
88-
and not isinstance(value, tslibs.Timestamp) \
89-
and notnull(value):
86+
if isinstance(value, (np.datetime64, datetime)) and (
87+
not isinstance(value, tslibs.Timestamp)) and (
88+
notnull(value)):
9089
value = tslibs.Timestamp(value)
91-
elif isinstance(value, (np.timedelta64, timedelta)) \
92-
and not isinstance(value, tslibs.Timedelta) \
93-
and notnull(value):
90+
elif isinstance(value, (np.timedelta64, timedelta)) and (
91+
not isinstance(value, tslibs.Timedelta)) and (
92+
notnull(value)):
9493
value = tslibs.Timedelta(value)
9594

9695
return value
@@ -123,7 +122,7 @@ def is_bool_indexer(key: Any) -> bool:
123122
"""
124123
na_msg = "cannot index with vector containing NA / NaN values"
125124
if isinstance(key, (ABCSeries, np.ndarray, ABCIndex)) or (
126-
is_array_like(key) and is_extension_array_dtype(key.dtype)
125+
is_array_like(key) and is_extension_array_dtype(key.dtype)
127126
):
128127
if key.dtype == np.object_:
129128
key = np.asarray(values_from_object(key))
@@ -219,7 +218,6 @@ def try_sort(iterable):
219218

220219

221220
def asarray_tuplesafe(values, dtype=None):
222-
223221
if not (isinstance(values, (list, tuple)) or hasattr(values, "__array__")):
224222
values = list(values)
225223
elif isinstance(values, ABCIndexClass):
@@ -288,10 +286,10 @@ def is_null_slice(obj):
288286
We have a null slice.
289287
"""
290288
return (
291-
isinstance(obj, slice)
292-
and obj.start is None
293-
and obj.stop is None
294-
and obj.step is None
289+
isinstance(obj, slice)
290+
and obj.start is None
291+
and obj.stop is None
292+
and obj.step is None
295293
)
296294

297295

@@ -308,7 +306,7 @@ def is_full_slice(obj, l):
308306
We have a full length slice.
309307
"""
310308
return (
311-
isinstance(obj, slice) and obj.start == 0 and obj.stop == l and obj.step is None
309+
isinstance(obj, slice) and obj.start == 0 and obj.stop == l and obj.step is None
312310
)
313311

314312

0 commit comments

Comments
 (0)