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!
Hi all,
I want to save a dataframe as a csv in a managed folder inside my Dataiku project.
To read files from the managed folder, I usually use this code (because my script is deployed as an API inside Dataiku)
folder_path = folders[0]
path_of_file = os.path.join(folder_path, "file_name_with_extension")
df = pd.read_csv(path_of_file)
But how about saving a dataframe as a csv in the managed folder?
Can someone please help me with this?
Thanks!
Operating system used: Windows
Hi,
Maybe I am wrong or don't understand the problem.
You have nothing more to do than writing to the managed folder, with the pandas library. You just have to change the name of the file, if you want to.
Did you try?
path_of_copy = os.path.join(folder_path, "copy_file_name_with_extension")
df.to_csv(path_of_copy)
Hope this helps.
Best
Hi,
Maybe I am wrong or don't understand the problem.
You have nothing more to do than writing to the managed folder, with the pandas library. You just have to change the name of the file, if you want to.
Did you try?
path_of_copy = os.path.join(folder_path, "copy_file_name_with_extension")
df.to_csv(path_of_copy)
Hope this helps.
Best
Does the same code work for storing a csv file into a managed folder. I need to do this via Python API endpoint function
When you say via Python API endpoint function what exactly do you mean? API endpoint function means to me an API you have developed and deployed in the Dataiku API node. If you donโt mean that please explain.