Skip to content

manumerous/vpselector

Repository files navigation

vpselector

The Visual Pandas Selector is a tool to visually select portions of numeric time-series data from a pandas dataframe. The tool is intended to provide an fast interactive way for manual data selection, as can be very useful in for example machine learning, regression or system identification.

Easily configure the tool to plot dataframe columns in vertically stacked subplots and view data distributions with the included histogram feature. With a simple click and drag, you can then select horizontal data windows, and let the tool automatically combine them into a new dataframe.

The user can subsequentially select different horizontal data windows via click and drag and he tool then automatically combines the visually selected sections into a new dataframe.

ezgif com-gif-maker(1)

Install

Install the package using:

pip install vpselector

Use in your project

Then simply import it using import vpselector. Then simply use:

  • If your project does not contain a pyqt application: vpselector.select_visual_data(data : pd.DataFrame, plot_config : dict)

  • To add the vpselector to an existing pyqt application: vpselector.select_visual_data_in_pyqt_app(data : pd.DataFrame, plot_config : dict, pyqt_app)

Run the Example

python3 vpselector_example.py

Use the Tool

  • Left click with your mouse and drag to define the desired horizontal window of the data to be selected.
    • The current selection distribution is now visualized in the histogram plot on the right.
  • Confirm or cancel data selection.
    • The already selected data is now marked by a grey span in the plot on the left.
    • The plot on the right contains now the histogram of all selected data.
  • repeat as many times as needed.
  • Once you could select all desired horizontal data windows click "Done selecting"