Problem with Q1

I got this error:
Q1: FAIL
train.csv wasn’t loaded properly
AssertionError : ‘prices_df’ doesn’t have the expected number of rows & columns

But the O/p seems right with the right number of rows and cols, Please help!
Screen Shot 2022-03-02 at 3.02.11 PM

The number of rows and columns already right. try restarting the kernel by going to Kernel > Restart & Run All. it probably fail because you’re not running it from top to bottom

Hi @odiesta Thank you for helping me out here. I followed the steps you mentioned but I am getting the same result
Q1: FAIL
train.csv wasn’t loaded properly
AssertionError : ‘prices_df’ doesn’t have the expected number of rows & columns

Q2: PASS

Q3: PASS

Q4: PASS

Q5: PASS

Q6: PASS

Q7: PASS

Q8: PASS

Q9: PASS

Q10: PASS

Screen Shot 2022-03-04 at 4.27.33 PM

Try using len() function. it works for me
n_rows = len(prices_df)
n_cols = len(prices_df.columns)
print('The dataset contains {} rows and {} columns.'.format(n_rows, n_cols))

Hi @odiesta I have done the above but still getting the same.

Q1: FAIL
train.csv wasn’t loaded properly
AssertionError : ‘prices_df’ doesn’t have the expected number of rows & columns

Q2: PASS

Q3: PASS

Q4: PASS

Q5: PASS

Q6: PASS

Q7: PASS

Q8: PASS

Q9: PASS

Q10: PASS

image

Here is my notebook link - https://hub.binder.jovian.ai/user/mailmenaveed88/api-git-b19242e-d09ebb6bd0b0_95-mtmezkgw/notebooks/python-sklearn-assignment.ipynb

could you share the jovian link of your notebook?

@odiesta here it is - https://jovian.ai/mailmenaveed88/python-sklearn-assignment

Don’t modify prices_df.

you mean to say, I should make a copy of prices_df and then do all the further calculations

Phew, finally that worked
Q1: PASS

Q2: PASS

Q3: PASS

Q4: PASS

Q5: PASS

Q6: PASS

Q7: PASS

Q8: PASS

Q9: PASS

Q10: PASS

The automatic assignment evaluation checks if the prices_df has correct number of rows and columns.

Deleting one of the columns with drop() in the latter part of the notebook causes the dataframe to have one column less than required.