deleted-user-PUOLzzPmi8Uz

Transpose an Attribute Table with Multi-Level Index

Discussion created by deleted-user-PUOLzzPmi8Uz on Apr 13, 2020
Latest reply on Apr 13, 2020 by deleted-user-PUOLzzPmi8Uz

Hi there. I am trying to take a feature class attribute table with n columns and rearrange its table structure so I can use it as a "Many" table in a relationship class, but I am struggling on how to transpose the table in arcpy and preserve two index columns, in this example, OBJECTID and ObjectType and export it as a .dbf. I was thinking pandas could do this, but my attempts to implement it has failed so far. Appreciate any help! Thanks.

 

The attribute table is a typical feature class structure and looks like this:

 

OBJECTIDObjectTypeAtrr2Attr3Attr4Attr5n….
1Red162Yes….
2Green433No….
3Blue325Yes….

 

What I need is the attribute structured like this:

 

 

OBJECTIDObjectTypeAttributeValue
1RedAtrr21
1RedAttr36
1RedAttr42
1RedAttr5Yes
2GreenAtrr24
2GreenAttr33
2GreenAttr43
2GreenAttr5No
3BlueAtrr23
3BlueAttr32
3BlueAttr45
3BlueAttr5Yes

Outcomes