Skip to content

Check for proper reset_index #134

@sbrugman

Description

@sbrugman

Try to respond to as many of the following as possible

Generally describe the pandas behavior that the linter should check for and why that is a problem. Links to resources, recommendations, docs appreciated

Users may not know how to properly reset the index, and come up with home-brew solutions. Not that frequent, but encountered it in an internal code base.

Suggest specific syntax or pattern(s) that should trigger the linter (e.g., .iat)

df.index = np.arange(0, len(df))

Suggest specific syntax or pattern(s) that the linter should allow (e.g., .iloc)

df = df.reset_index(drop=True)

Suggest a specific error message that the linter should display (e.g., "Use '.iloc' instead of '.iat'. If speed is important, use numpy indexing")

Are you willing to try to implement this check?

  • Yes
  • No
  • Maybe, with some guidance
  • Maybe, but not at this moment

Metadata

Metadata

Assignees

No one assigned

    Labels

    new checkNew check for the linter

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions