Playa

Pivot: Zonal Histogram Results Table

Discussion created by Playa on Jul 6, 2016
Latest reply on Jul 12, 2016 by Playa

I'm busy summarizing the landuse found within each of my watersheds using Zonal Histogram. I'd like to pivot the Hydro (i.e. Hydro_1236 etc.) columns to rows and pivot the Label Column values to column headings. I've attached the Zonal Histogram Results Table as well as a mock-up of the table structure that I'm looking for.

 

Watersheds_Landuse_160607.PNG

Watersheds + Land-use Raster

 

Zonal_Histogram_Results_160607.PNG

Zonal Histogram Results Table

 

Landuse_Classification_160607.PNG

Landuse Raster: Classification

 

Landuse_Labels_160607.PNG

Landuse Raster: Labels

 

Pivot_Results_Table_160706.PNG

Pivot Results Table:

 

Note that the HydroID field values were based on the following fields: Hydro_1236 etc. I removed "Hydro_" before adding them to the HydroID field.

 

How can I achieve the following using either Python Pivot Table or Pandas, thanks in advance for any help on the following.

Outcomes