Skip to content

Use of waypoints_df.drop() result is not assigned (route_planner.py:794) #349

@moraygrieve

Description

@moraygrieve

Describe the bug
In route_planner.py line 794 waypoints_df looks to be a pandas dataframe, so calling drop returns a reference to the new dataframe with the elements removed, rather than removing them in place.

  # Current (broken) — DataFrame unchanged                                                                                                
  waypoints_df.drop(idx)                                                                                                                  
                        
  # Fix                                                                                                                                   
  waypoints_df = waypoints_df.drop(idx)

The pandas documentation states that drop "Returns DataFrame or None DataFrame with the specified index or column labels removed or None if inplace=True." In this case inPlace is not given, and so defaults to False.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions