Select to view content in your preferred language

Is it possible to connect local data to ESRI's python live sandbox?

1332
3
02-08-2018 02:26 PM
WilliamJones3
New Contributor

I'm new to Python so bear with me. To learn how to start doing some of my ArcMap workflows in python, I started using ESRI's live sandbox (www.notebooks.esri.com). I'm able to do a few things in python using the files on my ArcGIS online account.

I'm now trying to get familiar with pandas. With ESRI's sandbox, is it possible for me to read in a CSV file that is on my local C drive? When I tried to read the csv file using an approach in a tutorial (e.g., pandas.read_csv('C:\\Users\\myname\\Documents\\Python_Test\\CDC.csv')), I kept getting the "FileNotFoundError" error.

If I can read in local files, are there any security concerns I should be aware of?

0 Kudos
3 Replies
ClintonDow1
Frequent Contributor

Assuming the file path is definitely correct, I have seen cases where copy/pasting the file path straight from Windows Explorer carries over an 'invisible' unicode character which can cause this issue. Please see this stack overflow post for more info: python - pandas.read_csv file not found despite correct path with raw text - Stack Overflow  

0 Kudos
WilliamJones3
New Contributor

I did originally copied and pasted the path into the command line, but after manually typing out the path, I'm still getting the same error. Since ESRI's sandbox is on the web, I'm starting to wonder if something else has to be done to get the web server to communicate with my local machine. I'm not finding a lot of online examples where people are importing local files from any of the Python sandboxes.

0 Kudos
ClintonDow1
Frequent Contributor

Ah yes I misunderstood what you meant, the notebooks on the sandbox site can be downloaded locally - I figured you had done so and were running it on your machine. If you do this, then you should be able to import the csv using that method. If you're using the online notebooks then you'd need to upload the csv to an accessible online location and provide the url instead of a file path.