Data Analysis - Transforming a Dataframe into desired output format | FIXED PROJECT $50

Job ID: 32981776

Budget: $30 – $250 USD

I have a Dataframe in the following format :

PART_ID, ITEM_NO, LOCATION_CATEGORY_1, LOCATION_DESCRIPTION_1, LOCATION_QUANTITY_1, LOCATION_CATEGORY_2, LOCATION_DESCRIPTION_2, LOCATION_QUANTITY_2, LOCATION_CATEGORY_3, LOCATION_DESCRIPTION_3, LOCATION_QUANTITY_3.... LOCATION_CATEGORY_10, LOCATION_DESCRIPTION_10, LOCATION_QUANTITY_10

Dataframe Description: Each PART_ID may have 1 or more ITEM_NO. Each ITEM_NO can be in 10 LOCATIONS. Each LOCATION has 3 DESCRIPTIVE fields associated with it - CATEGORY, DESCRIPTION, QUANTITY. So, for each ITEM_NO under a PART_ID has 10 LOCATIONS * 3 DESCRIPTORS = 30 Location Descriptors. Each ITEM_NO doesn't necessarily need to have data in all 10 location descriptors.


The ask: Instead of displaying all 10*3 = 30 location descriptors as columns, I want to display 3 Descriptors in COLUMNS & 10 Location details as ROWS.

An example of this can be found in the example file attached here.
Related categories: Python Data Analytics PySpark Data Modeling Pandas