pivot is a great function but results in a dataframe with a few extra info that I don\'t need: How can I achieve below? I do not need \"bar\" or \"foo\", and I want to make the
Set index and columns names to None:
index
columns
None
df.index.name = None df.columns.name = None
Or use rename_axis:
df = df.rename_axis(None).df.rename_axis(None, axis=1)