Skip to content
Discussion options

You must be logged in to vote

Because the visidata PandasSheet object uses a dataframe internally, as self.df, I think there is a simple way to do what you want. In your REPL setup, define edit_pandas, a slightly modified version of view_pandas().

import visidata
def edit_pandas(df):
    vd = visidata.vd
    sheet = visidata.PandasSheet('dataframe', source=df)
    vd.run(sheet)
    return sheet.df   #return the sheet's internal dataframe object

Then in your REPL, when you want to view the dataframe and keep the edited result, do:

import pandas as pd
df = edit_pandas(pd.DataFrame(range(10)))

However, I don't use Pandas or IPython, so I can't be sure this works in depth. Check the results carefully to make sure it's k…

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@saulpw
Comment options

Answer selected by weichm
Comment options

You must be logged in to vote
1 reply
@midichef
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants