These are chat archives for spyder-ide/public
.spyder-py3is 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).
project/part of the read_csv you already are in the
projectdirectory (silly me)
print(df.head())or type in the console
df.head(). You propably can also see the
dfvariable in the Variable Explorer
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
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
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
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)
/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
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).
\are directory separators, while
:are the path separators on Windows and *nix respectively.