Error in Python : List index out of range

Based on what I can see above. It seems it’s due to

data['post_id'] == id

This would be either true or false. Did you mean

def item(id):
    return posts.loc[id]['title'].tolist()[0]

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top