Pandas merge or sum values in rows with the same index

When the values are numeric and apply operators:

df.groupby(level=0).sum()
df.groupby(df.index).sum()
df[specifiedColumn].groupby(level=0).sum()

When the values are numeric and apply functions:

# Common usage, merging values
df[1].groupby(level=0).apply(lambda xList: ';'.join(list([x for x in xList])))

Source:
https://pandas.pydata.org/pandas-docs/version/0.22/generated/pandas.core.groupby.GroupBy.apply.html
https://pandas.pydata.org/docs/reference/api/pandas.core.groupby.GroupBy.sum.html

Pandas add an empty row or column to a dataframe with index

Add empty row with or without name:

df.append(pd.Series(name='NameOfNewRow')) # name the new row
df.append(pd.Series(), ignore_index=True) # not name the new row

Add empty column:

df['new'] = pd.Series()

Source:
https://stackoverflow.com/questions/39998262/append-an-empty-row-in-dataframe-using-pandas
https://stackoverflow.com/questions/16327055/how-to-add-an-empty-column-to-a-dataframe

Pandas remove rows or columns with null/nan/missing values

Remove rows with nan/null/missing values:

df = df.dropna(axis=0, how='any') # Remove if any value is na
df = df.dropna(axis=0, how='all') # Remove if all values are na

Remove columns with nan/null/missing values:

df = df.dropna(axis=1, how='any') # Remove if any value is na
df = df.dropna(axis=1, how='all') # Remove if all values are na

Defaut remove is inplace=False, if you want to remove inplace, add inplace=True

Source:
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.dropna.html