Skip to content

Filtering feature doesn't work on columns made with arithmetic expressions of other columns #258

@aedelgado19

Description

@aedelgado19

When you load in a df to display, then add in a column to that df that is currently displayed via the code, the column cannot be used to filter.

Steps to recreate issue:

  1. Display a dataframe in the pandastable GUI
  2. Create column that uses other columns (I have a function that generates column data based on other column arithmetic and it successfully fills the column with data). The expression I used was (({height_1} / {height_2}) < 0.1) and ({name} == "Bob") which fills a new column "to_be_checked" with true or false values successfully for each row.
  3. The new column appears in the manual filter dropdown, but if you use it in a filter (ex: filter for only "True"), pandastable code raises a KeyError since it cannot find the location with .get_loc(key)

shared images of error traceback -- the error is within pandastable code.
pandastableissue1
pandastableissue2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions