Google News
logo
Pandas - Interview Questions
How Will You Add An Index, Row, Or Column To A Dataframe In Pandas?
To add rows to a DataFrame, we can use .loc (), .iloc () and .ix(). The .loc () is label based, .iloc() is integer based and .ix() is booth label and integer based.

To add columns to the DataFrame, we can again use .loc () or .iloc ().
Advertisement