Skip to content

Commit 8469977

Browse files
committed
ENH: Provide dict object for to_dict() pandas-dev#16122
1 parent f297ee8 commit 8469977

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

pandas/core/frame.py

+1
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,7 @@ def to_dict(self, orient='dict', into=dict):
924924
{'a': {'col1': 1.0, 'col2': 0.5}, 'b': {'col1': 2.0, 'col2': 0.75}}
925925
926926
You can also specify the mapping type.
927+
927928
>>> from collections import OrderedDict, defaultdict
928929
>>> df.to_dict(into=OrderedDict)
929930
OrderedDict([('col1', OrderedDict([('a', 1), ('b', 2)])),

pandas/core/series.py

-2
Original file line numberDiff line numberDiff line change
@@ -1092,8 +1092,6 @@ def to_dict(self, into=dict):
10921092
Returns
10931093
-------
10941094
value_dict : collections.Mapping
1095-
If ``into`` is collections.defaultdict, the return
1096-
value's default_factory will be None.
10971095
10981096
Examples
10991097
--------

0 commit comments

Comments
 (0)