For this Question: Find the ten hotels with the lowest rating. Output the hotel name along with the corresponding average score.DataFrame/SQL Table with the following schema -
<schema>[{'name': 'hotel_reviews', 'columns': [{'name': 'hotel_address', 'type': 'object'}, {'name': 'additional_number_of_scoring', 'type': 'int64'}, {'name': 'review_date', 'type': 'datetime64[ns]'}, {'name': 'average_score', 'type': 'float64'}, {'name': 'hotel_name', 'type': 'object'}, {'name': 'reviewer_nationality', 'type': 'object'}, {'name': 'negative_review', 'type': 'object'}, {'name': 'review_total_negative_word_counts', 'type': 'int64'}, {'name': 'total_number_of_reviews', 'type': 'int64'}, {'name': 'positive_review', 'type': 'object'}, {'name': 'review_total_positive_word_counts', 'type': 'int64'}, {'name': 'total_number_of_reviews_reviewer_has_given', 'type': 'int64'}, {'name': 'reviewer_score', 'type': 'float64'}, {'name': 'tags', 'type': 'object'}, {'name': 'days_since_review', 'type': 'object'}, {'name': 'lat', 'type': 'float64'}, {'name': 'lng', 'type': 'float64'}]}]</schema>Each row in a new line and each value of a row is separated by a |, i.e.,
0|1|2
1|2|3
2|3|4-, I have written this Solution Code: # DataFrame already loaded with name <strong>hotel_reviews<strong>
df=hotel_reviews.head()
df=df.sort_values('reviewer_score', ascending=True)
for i,r in df.iterrows():
    print(r.hotel_name,'|',r.average_score), In this Programming Language: Python, Now tell me if this Code is compilable or not?