QST: How to export json as zip without directories #41517
Labels
Enhancement
IO Data
IO issues that don't fit into a more specific label
Needs Discussion
Requires discussion from core team before further action
Hello Everyone, I searched a possible answer for my question without success.
Suppose I start my python script in the root directory of this structure tree:
In this script I read a csv from files, with a
read_csv('files/filename.csv')
When I try to export a modified dataframe with
to_json('files/export.zip', compression='zip')
, I get a zipped file with the correct name, but when unzipping, I get a folder namedfiles
, and the json inside.How can I export the json file in zip without having the root
files
directory listed ?Note: This is a related problem below, but I was hoping a builtin solution with
to_json()
https://unix.stackexchange.com/questions/182032/zip-the-contents-of-a-folder-without-including-the-folder-itself
The text was updated successfully, but these errors were encountered: