Table Of Contents

Search

Enter search terms or a module, class or function name.

pandas.pivot

pandas.pivot(index, columns, values)[source]

Produce ‘pivot’ table based on 3 columns of this DataFrame. Uses unique values from index / columns and fills with values.

Parameters:

index : ndarray

Labels to use to make new frame’s index

columns : ndarray

Labels to use to make new frame’s columns

values : ndarray

Values to use for populating new frame’s values

Returns:
DataFrame

See also

DataFrame.pivot_table
generalization of pivot that can handle duplicate values for one index/column pair

Notes

Obviously, all 3 of the input arguments must have the same length

Scroll To Top