Skip to content

pandas is mutable #319

Open
Open
@Karim-53

Description

Checklist

Description

the default value of a parameter should be mutable like {}, [], or pd.DataFrame()

Pycharm is used to detect mutable objects but it doesn't work for pandas

Code Before

def f(df=pd.DataFrame()):
    pass

Code After

def f(df=None):
    if df is None:
        df=pd.DataFrame()

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions