These are chat archives for spyder-ide/public

21st
Jul 2018
Paul Gureghian
@paulgureghian_twitter
Jul 21 2018 01:02
anyone here ?
Carlos Cordoba
@ccordoba12
Jul 21 2018 01:02
Sure
Paul Gureghian
@paulgureghian_twitter
Jul 21 2018 01:02
can i post a screenshot here ?
or a link to google drive ?
Carlos Cordoba
@ccordoba12
Jul 21 2018 01:03
I think so, try to drag and drop the image on this tab
Paul Gureghian
@paulgureghian_twitter
Jul 21 2018 01:04
Capture10.PNG
Capture11.PNG
Carlos Cordoba
@ccordoba12
Jul 21 2018 01:06
And what are your questions?
Paul Gureghian
@paulgureghian_twitter
Jul 21 2018 01:07
im able to download a data /csv file from the uci repo into my project folder and open it in libre office. but when i try to open it with a pandas df, spyder console says "cant find the file". how to configure these settings when i create a project? and what is .spyder-py3 ? it seems to be created by spyder everytime
Paul Gureghian
@paulgureghian_twitter
Jul 21 2018 01:23
you here carlos ?
Daniel Althviz Moré
@dalthviz
Jul 21 2018 01:25
Hi @paulgureghian_twitter .spyder-py3 is the folder where the config settings of Spyder are. If you don't have any file open in the Editor, it will show a temporary file that is located in this directory (temp.py).
Paul Gureghian
@paulgureghian_twitter
Jul 21 2018 01:26
Capture12.PNG
how to get it to open in a project folder ?
when i create a new project the slashes are mixed up. some forward and one back
Daniel Althviz Moré
@dalthviz
Jul 21 2018 01:35
The mixed slashes probably are a bug to be fix :s
Paul Gureghian
@paulgureghian_twitter
Jul 21 2018 01:38
Capture13.PNG
why doesnt spyder see the downloaded csv file ? its there in the folder path and i opened it
Daniel Althviz Moré
@dalthviz
Jul 21 2018 01:40
try with a slash (/)
Paul Gureghian
@paulgureghian_twitter
Jul 21 2018 01:42
FileNotFoundError: File b'project/abalone.csv' does not exist
Daniel Althviz Moré
@dalthviz
Jul 21 2018 01:44
Please delete the project/part of the read_csv you already are in the project directory (silly me)
Paul Gureghian
@paulgureghian_twitter
Jul 21 2018 01:46
Capture14.PNG
no error. but no df.head() either
Daniel Althviz Moré
@dalthviz
Jul 21 2018 01:49
You will need to do something like print(df.head()) or type in the console df.head(). You propably can also see the df variable in the Variable Explorer
Paul Gureghian
@paulgureghian_twitter
Jul 21 2018 01:51
Capture15.PNG
so i cant have df.head() in the script ? print() in both console and script , without print only in the console ?
Carlos Cordoba
@ccordoba12
Jul 21 2018 01:56

when i create a new project the slashes are mixed up. some forward and one back

@dalthviz, please open an issue about this, so we don't forget to fix it

Daniel Althviz Moré
@dalthviz
Jul 21 2018 01:58
@ccordoba12 ok :+1:
Paul Gureghian
@paulgureghian_twitter
Jul 21 2018 01:58
in the meantime if i just straighten out the slash in the right direction will that work ?
Carlos Cordoba
@ccordoba12
Jul 21 2018 02:01

why doesnt spyder see the downloaded csv file ? its there in the folder path and i opened it

Besides what @dalthviz noted, another source for the error you're seeing in the screenshot above that statement is because you used a single slash to point to your file (i.e. 'projects\abalone.csv'). You can't write paths like that because a single slash is interpreted as a escape character by Python. Instead you need to write 'projects\\abalone.csv'

Paul Gureghian
@paulgureghian_twitter
Jul 21 2018 02:02
i just did "abalone.csv" and it worked
Carlos Cordoba
@ccordoba12
Jul 21 2018 02:04
Yes, I know. I was mentioning another source of error, which would apply if you had your file inside a subdirectory in your project
Paul Gureghian
@paulgureghian_twitter
Jul 21 2018 02:05
double slashes in relative and / or full path ?
i thought if it works in the script it will work in the console and vice versa. why does df.head() not work in the script ?
Carlos Cordoba
@ccordoba12
Jul 21 2018 02:07

so i cant have df.head() in the script ?

You can't if you run your file with F5 because that's equivalent to running your file as python foo.py. IPython (which is very different from plain Python) has several facilities oriented to quick exploration, and one of them is avoiding to enclose all statements in a print to see their results in the console.

double slashes in relative and / or full path ?

Yes, but that's because Windows uses \ as path separator, but \ is used in most programming languages as a escape character (as I said)

CAM Gerlach
@CAM-Gerlach
Jul 21 2018 06:15
Actually, the standard / equally valid on Windows as \, aside from calling certain command-line utilities from the cmd.exe, and possibly a few places in the GUI. Therefore, as these exceptions don't apply to Python (unless you're executing a platform-specific code branch anyway, like running a shell command with os.system() or subprocess.call()), it is just fine to use / universally for cross platform portability, as I do in my Python data science work on Windows (or pathlib , but that's somewhat out of scope of this answer).
Also, technically speaking, / and \ are directory separators, while ; and : are the path separators on Windows and *nix respectively.
Paul Gureghian
@paulgureghian_twitter
Jul 21 2018 15:33
Capture3.PNG
I installed Spyder 3.3, now im getting this. is it something to worry about? how to remove Spyder 3.28 ?
Carlos Cordoba
@ccordoba12
Jul 21 2018 17:40
No, there isn't