vanna icon indicating copy to clipboard operation
vanna copied to clipboard

Use Vanna with CSV files

Open zainhoda opened this issue 1 year ago • 6 comments

Should we make a vn.use_df function that loads data into sqlite and connects to it so that you can run Vanna on dataframes that you might have brought in via CSV or some other method?

zainhoda avatar Jul 22 '23 13:07 zainhoda

how would it work? can you write out the usage example? so it works something like this -

df = pd.read_csv('soccer_players.csv')
vn.use_df(df)
vn.ask('how many soccer players are there')

and behind the scenes, use_df creates a new sqlite db and sets that as the dataset? would we need to name the dataset like we do for other datasets?

ashishsingal1 avatar Jul 22 '23 13:07 ashishsingal1

Actually now that I think about this, in order to fit our general pattern, this should actually be:

vn.connect_to_dataframes

so example usage would look like:

df1 = pd.read_csv('soccer_players.csv')
df2 = pd.read_csv('baseball_players.csv')

vn.set_dataset('my-sports-dataset')

vn.connect_to_dataframes(df1, df2)

vn.auto_train() # Whatever we decide to call this later. 

vn.ask('how many soccer players are also baseball players?')

That way the pattern looks similar to the rest and we're just handling loading into SQLite inside connect_to_dataframes

zainhoda avatar Jul 22 '23 14:07 zainhoda

vn.connect_to_dataframes(df1, df2)

what does this do in the background? it creates a sqlite db, puts those two dfs in there, and then connects vanna to the sqlite?

ashishsingal1 avatar Jul 22 '23 15:07 ashishsingal1

what does this do in the background? it creates a sqlite db, puts those two dfs in there, and then connects vanna to the sqlite?

That's what I'm thinking

zainhoda avatar Jul 24 '23 18:07 zainhoda

Is this implemented yet ?

pratikkotian04 avatar May 03 '24 05:05 pratikkotian04

what does this do in the background? it creates a sqlite db, puts those two dfs in there, and then connects vanna to the sqlite?

That's what I'm thinking

wouldn't creating a sqlite db be an overkill?

mukesh1811 avatar Jun 25 '24 14:06 mukesh1811