writing Datasets in a human readable format
CONTRIBUTOR
AFAIK, there is currently no built-in method on the `Dataset` object to do this.
However, a workaround is to directly use the Arrow table backing the dataset, **but it implies loading the whole dataset in memory** (correct me if I'm mistaken @lhoestq).

You can convert the Arrow table to a pandas dataframe to save the data as csv as follows:
```python
arrow_table = dataset.data
dataframe = arrow_table.to_pandas()
dataframe.to_csv("/path/to/file.csv")
```

Similarly, you can convert the dataset to a Python dict and save it as JSON:
```python
import json
arrow_table = dataset.data
py_dict = arrow_table.to_pydict()
with open("/path/to/file.json", "w+") as f:
    json.dump(py_dict, f)
```
2021-02-02T10:56:23Z
https://github.com/huggingface/datasets/issues/1808#issuecomment-771551715
https://api.github.com/repos/huggingface/datasets/issues/1808
MDEyOklzc3VlQ29tbWVudDc3MTU1MTcxNQ==
https://api.github.com/repos/huggingface/datasets/issues/comments/771551715/reactions
2021-02-02T10:56:23Z
https://api.github.com/repos/huggingface/datasets/issues/comments/771551715
https://avatars.githubusercontent.com/u/33657802?v=4
https://api.github.com/users/SBrandeis/events{/privacy}
https://api.github.com/users/SBrandeis/followers
https://api.github.com/users/SBrandeis/following{/other_user}
https://api.github.com/users/SBrandeis/gists{/gist_id}
https://github.com/SBrandeis
SBrandeis
MDQ6VXNlcjMzNjU3ODAy
https://api.github.com/users/SBrandeis/orgs
https://api.github.com/users/SBrandeis/received_events
https://api.github.com/users/SBrandeis/repos
https://api.github.com/users/SBrandeis/starred{/owner}{/repo}
https://api.github.com/users/SBrandeis/subscriptions
User
https://api.github.com/users/SBrandeis
public
MEMBER
Indeed this works as long as you have enough memory.
It would be amazing to have export options like csv, json etc. !

It should be doable to implement something that iterates through the dataset batch by batch to write to csv for example.
There is already an `export` method but currently the only export type that is supported is `tfrecords`.
2021-02-02T15:04:08Z
https://github.com/huggingface/datasets/issues/1808#issuecomment-771697974
https://api.github.com/repos/huggingface/datasets/issues/1808
MDEyOklzc3VlQ29tbWVudDc3MTY5Nzk3NA==
https://api.github.com/repos/huggingface/datasets/issues/comments/771697974/reactions
2021-02-02T15:04:08Z
https://api.github.com/repos/huggingface/datasets/issues/comments/771697974
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
COLLABORATOR
Hi! `datasets` now supports `Dataset.to_csv` and `Dataset.to_json` for saving data in a human readable format.
2022-06-01T15:38:10Z
https://github.com/huggingface/datasets/issues/1808#issuecomment-1143769014
https://api.github.com/repos/huggingface/datasets/issues/1808
IC_kwDODunzps5ELIe2
https://api.github.com/repos/huggingface/datasets/issues/comments/1143769014/reactions
2022-06-01T15:38:10Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1143769014
https://avatars.githubusercontent.com/u/47462742?v=4
https://api.github.com/users/mariosasko/events{/privacy}
https://api.github.com/users/mariosasko/followers
https://api.github.com/users/mariosasko/following{/other_user}
https://api.github.com/users/mariosasko/gists{/gist_id}
https://github.com/mariosasko
mariosasko
MDQ6VXNlcjQ3NDYyNzQy
https://api.github.com/users/mariosasko/orgs
https://api.github.com/users/mariosasko/received_events
https://api.github.com/users/mariosasko/repos
https://api.github.com/users/mariosasko/starred{/owner}{/repo}
https://api.github.com/users/mariosasko/subscriptions
User
https://api.github.com/users/mariosasko
public
Hi
I see there is a save_to_disk function to save data, but this is not human readable format, is there a way I could save a Dataset object in a human readable  format to a file like json? thanks @lhoestq 