Skip to main content
100%

Transformation of DataFrame

✓ Published0🌍 Public
VVioletVivirand
Last edited Apr 24, 2017
Created on Apr 24, 2017

This example demonstrates a straightforward transformation of a pandas DataFrame into a two-column structure, converting the original column headers and first-row values into paired “node” and “value” entries. The code builds a list of tuples via `zip(df.columns.tolist(), df.iloc[0,:].values.tolist())`, then wraps it in a new `pd.DataFrame` with the specified column names. No visualization library or rendering occurs; the output is purely tabular, showing how data can be reshaped for downstream analysis or charting.

AI-generated description

Similar vizzes