Forums

Python Newbie: Path to the folder i created on the free storage on pythonanywhere

I have saved a data file on the following path "/home/useridXXX/MLPython/Code/filename.tsv"

I am getting error when i try to access it, i get an error.

Please help. Regards,

Amit

Code Used:

import os
import scipy as sp
import matplotlib.pyplot as plt

data = sp.genfromtxt("/home/amitkb3/MLPython/Code/web_traffic.tsv", delimiter="\t")

[edited by admin: formatting]

What error did you get exactly? I have never used scipy but according to the docs, genfromtxt() is actually part of numpy library.

Are you sure you're using the right path?

@harry: Sure, blame the user...j/k Your question was my first thought too...☺

~a2j

Right. In this case I do have more than just a strong suspicion -- we usually wait for explicit permission before we look at people's files, but in this case I'll admit, that, in a desire to help, I took a peek, perhaps taking the support request as a tacitly suggestion that I should help debug...

@amitkb3, it looks like you have actually uploaded your file to

/home/amitkb3/MLPython/Data/web_traffic.tsv

Not

/home/amitkb3/MLPython/Code/web_traffic.tsv

Hi harry, Thanks for your help. I indeed had saved it in data folder. I really apprrciate all your help as well as others' who provided help.

Amit

It's an easy mistake to make. I'm silly enough to have some of my static files folders configured to a path that is different for local and public facing web access with different words just like this example of Data vs. Code.

I've had to retype something more than once using it this way.