In ArcGIS Online, I would like to create a CSV from a data frame in ArcGIS API for Python using .to_csv, however I don't know where to access the result. For example, the code below should write the file "output.csv" somewhere. It doesn't create an error, but I cannot see it listed in AGOL. I've also tried my folder names created in AGOL, but don't see the CSV listed.
import pandas as pd
df = pd.DataFrame({'A': [1, 2], 'B': [3, 4]})
df.to_csv('output.csv', index=False)
Solved! Go to Solution.
In an ArcGIS Notebook, in ArcGIS Online, the file system is accessible from the Files menu.
You can save to the default location, or import the OS module in Python and make new folders, work with paths, like you would locally.
See this for example:
https://www.arcgis.com/home/item.html?id=fe8a61ca94c54e6e8e62c2faed0b68cf#preview
creating and sharing csv's
CSV, TXT, and GPX files—ArcGIS Online Help | Documentation
In an ArcGIS Notebook, in ArcGIS Online, the file system is accessible from the Files menu.
You can save to the default location, or import the OS module in Python and make new folders, work with paths, like you would locally.
See this for example:
https://www.arcgis.com/home/item.html?id=fe8a61ca94c54e6e8e62c2faed0b68cf#preview
Fabulous, helps immensely. Don't know why I never noticed that little Files button....