Skip to content

set_option as a context manager #5618

Closed
@jseabold

Description

@jseabold

It doesn't look like it's available yet as such, but it might be nice to have set_option usable as a context manager. E.g., I often find myself wanting to do something like

with pd.set_option('max_rows', 200):
    print df

As simple as adding __enter__ and __exit__ methods and preserving state?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions