r/PythonLearning • u/Glittering_Ad_4813 • Nov 04 '25
[ Removed by moderator ]
/r/PythonLearning/comments/1oo8s2f/removed_by_moderator/[removed] — view removed post
0
Upvotes
r/PythonLearning • u/Glittering_Ad_4813 • Nov 04 '25
[removed] — view removed post
2
u/FoolsSeldom Nov 04 '25 edited Nov 04 '25
I've just tried the code and did not have any problems.
I created a sample data file using the Python code below (generated by Gemini):
Created the file
helpers.py, with the following from your screenshot:and the main code file from your screenshot:
So if your code didn't work, there are several possibilities:
data file is not as expected
data is not in location expected / not accessible
helpers.pyis not in the same folder you are running the code inYou haven't given any details about the "not work" part - how did you try to run the code, and what error messages, if any, did you get? [I realise you shared some screenshots, but they are hard to make out.]
PS. Generally, iterating over a dataframe is considered a last resort, whenever possible use vector operations.
PPS. PLEASE share actual code and error messages in post where possible, rather than screenshots, and actual screenshots rather than poor quality photographs of your screen if you can't share the code.