normally using jupyternotes I can import pandas make my dataframe and export to csv.
I'm trying to automate this reoccurring query with a python script. I can't figure out how to test my script because I cant print out the df to screen. In jupyternotes I just need to type out the df name in any cell and it will display.
here what I'm doing
import pandas as pd
def run_agg_query(db):
df1 = pd.read_sql( "select some query",conn)
display(df1)
but I cant get the df to display.
print(df1)not work? or you may needfrom IPython.display import display? Also, are you getting any error?