Week 4 assignment- implementing in COLAB

I was trying to implement the Wk4 assignment in Colab. However, I am running into the following error. [AttributeError: ‘DataFrame’ object has no attribute ‘iteritems’]

I tried to resolve it by including the following code,
import pandas as pd
pd.DataFrame.iteritems = pd.DataFrame.items

But it resulted in another error.
Attaching a screenshot of the same for reference. Any help would be highly appreciated.

1 Like

Hi @Sandhya_Soman

Can you confirm if you are trying to run the assignment notebook codes in your local Colab environment??

if the above answer is yes, can I know if you have downloaded all the files required you to run the run codes in your local Colab environment?

Also confirm the assignment Name you doing, you have selected AI for Medical Prognosis and week4 which I checked with my assignment codes and don’t seem to match, so kindly confirm this too!!

Regards
DP

Hi Deepti,

Yes I am running in my local Colab env. And i have downloaded all the necessary files. All those issues are sorted out. I only stuck with the last but third code cell. I was initially getting error due to iteritems() which i understood are now used only in older version of pandas. So, I have used a workaround as mentioned in the post. But then, again I am unable to proceed.

1 Like

and you have used same code as week 4 assignment name?

Yes

1 Like

can you share the link to the colab via personal DM. kindly don’t post the link here as you are practicing a graded course assignment.

regards
DP

Sure, I have sent the link. Kindly confirm

1 Like

If possible, please send me your notebook.

Hi @Sandhya_Soman

Your code error is coming from the below code line

pd.DataFrame.iteritems = pd.DataFrame.items

error is stating the data frame doesn’t have the attribute iterates. So can you explain why this step was added as I don’t see this code in the assignment.

Sorry for the delay in response I was away from work desk!!

Regards
DP

Hi @Deepti_Prasad

I have replied in DM.

2 Likes