8. Reshape
Reshape the Data into Long or Wide Format
Click the Reshape under the Data Analysis category.
Reshape type: Select a reshape type.
Pivot: Reorganize the data into a wide data format.
Pivot Table: Reorganize the data into a wide data format, and apply the Aggregation function if there are duplicate indexes or columns.
Melt: Reorganize the data into a long data format.
Pivot & Pivot Table
DataFrame: Select the dataframe that will be reconstructed with wide data.
Index: Select a column to set as the index in the reorganized dataframe.
Columns: Select the columns you want to set as columns in the reorganized dataframe.
Values: Select the columns you want to populate with values for each column in the reorganized dataframe.
Aggregate (Pivot Table): Select the aggregation function you want to apply to the duplicate indexes or columns. If you select multiple aggregation functions, the results of each function are generated separately.
For example, applying the Count and First aggregation functions to columns A, B, and C results in a total of six columns.
User Option: You can add options beyond what Visual Python provides.
Allocate to: Specify a variable name to assign to the result.
Reset Index: Reset the index to specify a new default integer index.
Code View: Preview the code that will be output.
Data View: Preview the output to be printed.
Run: Print and run the code.
Melt
DataFrame: Select the dataframe that will be reconstructed with long data.
Id: Select the column(s) you want to designate as fixed variables in the reorganized dataframe. These columns will remain intact in the reorganized dataframe.
The names of the column(s) selected in Value are populated in the Var name column of the reconstructed dataframe, and the values are populated in the Value name column.
User Option: You can add options beyond what Visual Python provides.
Allocate to: Specify a variable name to assign to the result.
Reset Index: Reset the index to specify a new default integer index.
Code View: Preview the code that will be output.
Data View: Preview the output that will be printed.
Run: Print and run the code.
Last updated