ayush singh
ayush singh

Reputation: 1

failed to correct : this error SyntaxError: positional argument follows keyword argument

most_rated = pd.DataFrame(["135085","132825","135032","135052","132834"], index=np.arange(5), columns['placeID'])

This code is not working, instead showing this error.

Upvotes: 0

Views: 589

Answers (2)

Amardeep Flora
Amardeep Flora

Reputation: 1380

Try this.

most_rated = pd.DataFrame({"135085","132825","135032","135052","132834"}, index=np.arange(5), columns=["placeID"])

Upvotes: 1

Chance
Chance

Reputation: 488

So the problem is that you've got a keyword argument, that is, one that starts with arg_name= before a positional argument - that is, one that doesn't start with a arg_name=. In this case, it's that you have index=np.arange(5) before the final argument, columns['placeID']. You need to specify whichever positional arguments you want before ANY keyword arguments.

Upvotes: 0

Related Questions