Partial Pivoting In Pandas SQL Or Spark
Make the Year remain as Rows, and have the States Transpose to columns Take Pecentage value of a Gender Male Race White,
Input
Output
Partial Pivoting In Pandas SQL Or Spark
Make the Year remain as Rows, and have the States Transpose to columns Take Pecentage value of a Gender Male Race White,
Input
Output
Answer Posted By @Peter Leimbigler as comment
df.pivot_table(index='Year', columns='States', values='Percentage')
I tried it works.. Thanks Peter