Setting Index

This quiz covers how to set an index of a DataFrame in Pandas.

Index setting in Pandas

1

How can an index be set in a DataFrame without needing to assign the return value to a new variable?

A)

df.set_index('column', inplace=True)

B)

df = df.set_index('column')

C)

df = df.set_index('column', within=True)

Question 1 of 30 attempted

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.