繁体   English   中英

用于编辑和保存 python pandas dataframe 的 GUI

[英]GUI for editing and saving a python pandas dataframe

In a python function I want to show the user a pandas dataframe and let the user edit the cells in the dataframe. 我的 function 应该使用 dataframe 中的编辑值(即它们应该被保存)。

我试过 pandasgui,但它似乎没有将编辑返回到 function。

有没有我可以使用的函数/库?

最近用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)

昨天我在使用 dtale 时遇到了一些错误。 过滤破坏了我的更改并创建了一些我不需要的新行。 通常我一起使用 dtale 和 pandasgui。 希望能帮助到你!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM