Python: Pandas Data Manipulations
Data Manipulations
Python Data Manipulation functions are: melt(), pivot(), pivot_table(), crosstab(), cut(), qcut(), merge(), merge_ordered(), merge_asof(), concat(), get_dummies(), factorize(), unique() and wide_to_long()
| Functions Name | Description |
|---|---|
| melt() | Unpivot a DataFrame from wide format to long format, optionally leaving identifier variables set. |
| pivot(data[, index, columns, values]) | Return reshaped DataFrame organized by given index / column values. |
| pivot_table(data[, values, index, columns, ...]) | Create a spreadsheet-style pivot table as a DataFrame. |
| crosstab(index, columns[, values, rownames, ...]) | Compute a simple cross tabulation of two (or more) factors. |
| cut(x, bins[, right, labels, retbins, ...]) | Bin values into discrete intervals |
| qcut(x, q[, labels, retbins, precision, ...]) | Quantile-based discretization function. |
| merge(left, right[, how, on, left_on, ...]) | Merge DataFrame or named Series objects with a database-style join. |
| merge_ordered(left, right[, on, left_on, ...]) | Perform merge with optional filling/interpolation designed for ordered data like time series data. |
| merge_asof(left, right[, on, left_on, ...]) | Perform an asof merge. |
| concat(objs[, axis, join, join_axes, ...]) | Concatenate pandas objects along a particular axis with optional set logic along the other axes. |
| get_dummies(data[, prefix, prefix_sep, ...]) | Convert categorical variable into dummy/indicator variables. |
| factorize(values[, sort, order, ...]) | Encode the object as an enumerated type or categorical variable. |
| unique(values) | Hash table-based unique. |
| wide_to_long(df, stubnames, i, j[, sep, suffix]) | Wide panel to long format. |
Previous: Python pandas tutorials
Next: melt() function
