Skip to content

Feature Request: Provide dict object for pd.Series.to_dict() #16122

Closed
@jolespin

Description

@jolespin

I frequently use the .to_dict() method and was wondering how difficult it would be to implement a dict_obj argument to specify what type of dictionary will be used. For example, if one was interested in preserving the order:

from collections import OrderedDict

pd.Series(list("abcd")).to_dict(dict_obj=OrderedDict)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions