Dividing by length

I have some doubts with dividing by len(app_data[1:]). I think it should be len(app_data[1:][7]. Because I think that len(app_data[1:]) is not the length of rating. Could anyone clarify the doubt here? Thank you.

1 Like

We don’t divide by the length of the rating. We divide by the number of ratings since we are calculating the average.

app_data[1:] gives us all the lists/rows in our data (without the header). The length of that is the number of rows and that is the same as the number of ratings.
app_data[1:][7] will give us a single list at the 7th index in our data. The length of that will be the number of columns. We can’t calculate the average with the number of columns.

For any future queries, please create a separate post.

1 Like

Hi @kmyat3116,

Welcome to the Community!

I’ve relocated your post to a new topic. As @the_doctor suggested, for any future questions, please opt for creating a separate post.

Also, if you feel that this your question was successfully solved by @the_doctor, could you please mark his answer as Solution? You can find here how to do it technically (in the GUIDELINE #5 ). Please consider this practice also for any other questions you might ask in the Community. This would be of great help both to your helpers and the other learners who can have the same questions in the future.

Happy learning! :rocket: