Skip to content

[ENH] Reset index after row/s delete in row_to_names() ?  #285

Closed
@dsouzadaniel

Description

@dsouzadaniel

I see a possible operation that may cause the index to go out of whack in the row_to_names() function:


    if remove_row:
        df = df.drop(df.index[row_number])

    if remove_rows_above:
        df = df.drop(df.index[range(row_number)])

In both these cases, when rows are deleted post a column name change operation, there is a good chance of having a bad index.

Sometimes it's exactly what you need, but most of the time it's probably bad news. 🐈

Need input on whether to make reset_index(drop=True) default? or make the reset_index() default with optional drop argument? Help! @zbarry @szuckerman 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood intermediate issueIssues that are good for seasoned programmers to make a contributionquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions