![]() |
VOOZH | about |
Pandas DataFrame is two-dimensional size-mutable, potentially heterogeneous tabular data structure with labeled axes (rows and columns).
Let's see how can we can add a row at top in pandas DataFrame.
Observe this dataset first.
Code #1: Adding row at the top of given dataframe by concatenating the old dataframe with new one.
Output:
Code #2: Adding row at the top of given dataframe by concatenating the old dataframe with new one.
Output:
Code #3: Adding row at the top of given dataframe by concatenating the old dataframe with new one using df.ix[] method.
Output: