GUI for editing and saving a python pandas dataframe

Viewed 53

In a python function I want to show the user a pandas dataframe and let the user edit the cells in the dataframe. My function should use the edited values in that dataframe (i.e. they should be saved).

I've tried pandasgui, but it does not seem to return the edits to the function.

Is there a function/library I can use for this?

1 Answers

Recently solved this problem with dtale

import pandas as pd
import dtale


df = pd.read_csv('table_data.csv')

dt = dtale.show(df)  # create dtale with our df
dt.open_browser()  # bring it to a new tab (optional)

df = dt.data  # connect all the updates from dtale gui and our df 
              # (so rn if u edit any cell, you will immediately get the result saved in ur df)

Yesterday I came across with some bugs while using dtale. Filtering broke my changes and creating some new rows I dont need. Usually I use dtale and pandasgui together. Hope it helps!

Related