It seems like the codes in the lab and assignments are outdated as of December 2023. There are lots of functions which have been deprecated in the newer version of the packages. For example, to concatenate two dataframe,
df1.append(df2) which is deprecated in the newer version. the same thing can be done by
pd.concat(df1, df2) .
This is the problem I am facing while running the codes on my personal computer. So I just want to know if there are
requirements.txt like file available where required packages with their versions are written.
if you have subscribed to the course, then all the required files related to the assignment can be saved by clicking on lab files, which will give all the necessary files required to download, if doing the assignment on your personal Jupyter notebook.
Unfortunately there is no official version of a procedure to run the assignments in a different environment. It’s not a simple matter and there are just too many different environments. But there are a couple of threads by fellow students that give some guidance about how to get started on that, including how to derive the
requirements.txt file. Here’s one and here’s another one.
The high level point here is that it’s not reasonable to expect us to be your IT support staff for your own personal environment, so you need to develop or strengthen your own problem solving skills for that type of issue. The good news is that StackExchange and other such sites are powerful resources.
Just to expand on Deepti’s point a bit, there is an easy way to download all the associated files along with any of the notebooks, as documented on this thread. There is no way to do that in “one shot” for an entire course, though: you have to handle each assignment separately.
Thank you @Deepti_Prasad, for your reply.
I have downloaded all of the necessary files. But, As the versions of the packages used in those assignments are not matching with the installed version of those packages in my computer or environment, Some of the codes/functions which have been deprecated in the newer versions are not working and showing errors (like there is no
append function in dataframe object).
It would be better if I could get the versions of the packages that have been used in the assignments or in the whole course.
Thank you, @paulinpaloalto!
I got the idea to solve my problem from the links you provided. Here is a small description of what I did:
!pip freeze in a cell of a running Jupyter notebook on the Coursera platform.
- copied all of the text from the output.
- Then listed in a new .txt file in my directory.
- Then installed all of the packages using the
pip install -r requirements.txt command in my environment.
One insight that I got is that for the Week 1 assignment on the Coursera platform, Pandas version 0.25.3 has been used, but the current Pandas version is 2.1.4 as of December 2023. That is why I was facing the issues.
Now, everything is running fantastically.
Thanks a lot once again for your time.
That’s great news that you were able to get things to work by using the information on those threads. Thank you for confirming and for sharing your results, which may help others who see this thread in the future.