Skip to content

Commit 3e8b84a

Browse files
committed
Reformat to comply with PEP8
1 parent 0500d97 commit 3e8b84a

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

pandas/core/base.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
is_categorical_dtype,
2020
is_dict_like,
2121
is_extension_array_dtype,
22+
is_hashable,
2223
is_list_like,
2324
is_object_dtype,
2425
is_scalar,
@@ -472,7 +473,7 @@ def is_any_frame() -> bool:
472473
except ValueError:
473474

474475
# we have a dict of scalars
475-
476+
476477
name = getattr(self, "name", None)
477478
name = name if is_hashable(name) else None
478479
# GH#36212

pandas/tests/frame/apply/test_frame_apply.py

+8-9
Original file line numberDiff line numberDiff line change
@@ -1148,21 +1148,20 @@ def test_demo(self):
11481148
tm.assert_frame_equal(result.reindex_like(expected), expected)
11491149

11501150
def test_agg_with_unhashable_name_column_value(self):
1151-
#GH 36212 - Column name is "name"
1152-
data = {'name': ['foo', 'bar']}
1151+
# GH 36212 - Column name is "name"
1152+
data = {"name": ["foo", "bar"]}
11531153
df = pd.DataFrame(data)
11541154

1155-
#result's name should be None
1156-
result = df.agg({'name': 'count'})
1157-
expected = pd.Series({'name':2})
1155+
# result's name should be None
1156+
result = df.agg({"name": "count"})
1157+
expected = pd.Series({"name": 2})
11581158
tm.assert_series_equal(result, expected)
11591159

1160-
#Check if name is preserved when aggregating series instead
1161-
result = df['name'].agg({'name':'count'})
1162-
expected = pd.Series({'name':2}, name='name')
1160+
# Check if name is preserved when aggregating series instead
1161+
result = df["name"].agg({"name": "count"})
1162+
expected = pd.Series({"name": 2}, name="name")
11631163
tm.assert_series_equal(result, expected)
11641164

1165-
11661165
def test_agg_multiple_mixed_no_warning(self):
11671166
# GH 20909
11681167
mdf = pd.DataFrame(

0 commit comments

Comments
 (0)