Skip to content

Commit 86af367

Browse files
committed
Reformat to comply with PEP8
1 parent 5cacaf2 commit 86af367

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
@@ -1132,21 +1132,20 @@ def test_demo(self):
11321132
tm.assert_frame_equal(result.reindex_like(expected), expected)
11331133

11341134
def test_agg_with_unhashable_name_column_value(self):
1135-
#GH 36212 - Column name is "name"
1136-
data = {'name': ['foo', 'bar']}
1135+
# GH 36212 - Column name is "name"
1136+
data = {"name": ["foo", "bar"]}
11371137
df = pd.DataFrame(data)
11381138

1139-
#result's name should be None
1140-
result = df.agg({'name': 'count'})
1141-
expected = pd.Series({'name':2})
1139+
# result's name should be None
1140+
result = df.agg({"name": "count"})
1141+
expected = pd.Series({"name": 2})
11421142
tm.assert_series_equal(result, expected)
11431143

1144-
#Check if name is preserved when aggregating series instead
1145-
result = df['name'].agg({'name':'count'})
1146-
expected = pd.Series({'name':2}, name='name')
1144+
# Check if name is preserved when aggregating series instead
1145+
result = df["name"].agg({"name": "count"})
1146+
expected = pd.Series({"name": 2}, name="name")
11471147
tm.assert_series_equal(result, expected)
11481148

1149-
11501149
def test_agg_multiple_mixed_no_warning(self):
11511150
# GH 20909
11521151
mdf = pd.DataFrame(

0 commit comments

Comments
 (0)