How to save file in subfolder when I using dataiku.Folder("xxxxxx")?
dataicool
Registered Posts: 6 ✭
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
Answers
-
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,