Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
python code, I save dataframe as csv๏ผ
#df is pd.DataFrame
csv_name = "data.csv"
handle = dataiku.Folder("xxxxxxx")
with handle.get_writer(csv_name) as w:
w.write(df.to_csv().encode('utf-8'))
Now I want to save csv in subfolder,
for example save_path = dataiku.Folder("xxxxxxx")/subfolder1/data.csv
how to change my code?
thanks
Operating system used: windows
Hi @dataicool
you can use:
csv_name = "/subfolder1/data.csv"
with handle.get_writer(csv_name) as w:
w.write(df.to_csv().encode('utf-8'))
Hope this helps,
code works๐๐๐, thanks a lot,