Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with filepaths #1021

Open
NidhiGowdra opened this issue Nov 6, 2022 · 2 comments
Open

Issues with filepaths #1021

NidhiGowdra opened this issue Nov 6, 2022 · 2 comments
Labels
type:enhancement Propose enhancement to the lesson

Comments

@NidhiGowdra
Copy link

Some users might have trouble reading data if they use relative paths after downloading and extracting the dataset provided in setup.

Good to add a note of using Absolute paths.

Relative paths:
numpy.loadtxt("inflammation-01.csv")

Absolute Paths:
Windows:
numpy.loadtxt("D:\python-novice-inflammation-data\data\inflammation-01.csv")
or
numpy.loadtxt(r"D:\python-novice-inflammation-data\data\inflammation-01.csv")

Linux/MacOS:
numpy.loadtxt("D:/python-novice-inflammation-data/data/inflammation-01.csv")

Setting the path to the current working directory where the program is being executed:
import os
os.chdir(os.getcwd())

@emilygrabowski
Copy link

Along these lines I'd suggest adding notes indicating what the working directory should be / where files should be saved at key points in the lesson.

For example in the Command-Line episode:
$ python ../code/readings_04.py --max inflammation-*.csv assumes that the programmer is currently in the data directory, while $ python sys_version.py appears to be geared towards programmers being in the code directory, but these are not called out explicitly and can trip people up.

@bjricketts
Copy link

Would it be a good idea to have that short note about the working directory in either the Python Fundamentals episode or the Analyzing Patient Data episode? I've discussed the working directory for students at the start of Analyzing Patient Data episode when first loading in the data as it feels like the first place that a user can get tripped up.

On the same topic, there is a short note during setup that the user should be in the data folder but it only appears in the Juypter notebook setup. I think the setup should make a note that the user should be in the data folder (which isn't hidden inside of a drop down of one of the options of launching the python interface).

@AlbertoImg AlbertoImg added the type:enhancement Propose enhancement to the lesson label Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Propose enhancement to the lesson
Projects
None yet
Development

No branches or pull requests

4 participants