Skip to content

Commit e68a779

Browse files
committed
Corrected C408 Unnecessary dict call errors
1 parent bb50bc6 commit e68a779

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed

doc/source/whatsnew/v0.14.0.rst

+23-19
Original file line numberDiff line numberDiff line change
@@ -772,28 +772,32 @@ Enhancements
772772

773773
.. ipython:: python
774774
775-
household = DataFrame(dict(household_id=[1, 2, 3],
776-
male=[0, 1, 0],
777-
wealth=[196087.3, 316478.7, 294750]),
775+
household = DataFrame({
776+
'household_id': [1, 2, 3],
777+
'male': [0, 1, 0],
778+
'wealth': [196087.3, 316478.7, 294750]
779+
},
778780
columns=['household_id', 'male', 'wealth']
779781
).set_index('household_id')
780782
household
781-
portfolio = DataFrame(dict(household_id=[1, 2, 2, 3, 3, 3, 4],
782-
asset_id=["nl0000301109",
783-
"nl0000289783",
784-
"gb00b03mlx29",
785-
"gb00b03mlx29",
786-
"lu0197800237",
787-
"nl0000289965",
788-
np.nan],
789-
name=["ABN Amro",
790-
"Robeco",
791-
"Royal Dutch Shell",
792-
"Royal Dutch Shell",
793-
"AAB Eastern Europe Equity Fund",
794-
"Postbank BioTech Fonds",
795-
np.nan],
796-
share=[1.0, 0.4, 0.6, 0.15, 0.6, 0.25, 1.0]),
783+
portfolio = DataFrame({
784+
'household_id': [1, 2, 2, 3, 3, 3, 4],
785+
'asset_id': ["nl0000301109",
786+
"nl0000289783",
787+
"gb00b03mlx29",
788+
"gb00b03mlx29",
789+
"lu0197800237",
790+
"nl0000289965",
791+
np.nan],
792+
'name': ["ABN Amro",
793+
"Robeco",
794+
"Royal Dutch Shell",
795+
"Royal Dutch Shell",
796+
"AAB Eastern Europe Equity Fund",
797+
"Postbank BioTech Fonds",
798+
np.nan],
799+
'share': [1.0, 0.4, 0.6, 0.15, 0.6, 0.25, 1.0]
800+
},
797801
columns=['household_id', 'asset_id', 'name', 'share']
798802
).set_index(['household_id', 'asset_id'])
799803
portfolio

0 commit comments

Comments
 (0)