Dr. Smith is working with a pandas DataFrame df_health that currently uses numerical indices. He decides to switch the DataFrame's indices to use unique patient IDs stored in a list: ['ID101', 'ID102', 'ID103', 'ID104']. Which of the following options correctly sets these patient IDs as the new indices for the DataFrame?

1
df_health.set_index(['ID101', 'ID102', 'ID103', 'ID104'])
2
df_health.index['ID101', 'ID102', 'ID103', 'ID104']
3
df_health.index = ['ID101', 'ID102', 'ID103', 'ID104']
4
df_health.index() == ['ID101', 'ID102', 'ID103', 'ID104']

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation