Vlookup the attribute and then Transpose rows to column using Python

Viewed 55

I have the following dataframe...

idx |Group | Family | Quantity
1 |Apple | Fuji | 100 2 |Apple | Granny Smith| 20
3 |Apple | Gala |100
4 |Apple | Honeycrisp |88
5 |Apple | Brecheche | 60
6 |Apple | McIntosh |70
7 |Apple | Gala | 44

and another data frame which consists of auditing attributes for each fruits category

Group audit Audit variations

Orange | Size

     | Color

     | Number_Of_Items

Apple | Quality

     | Variations

     | Family

     | Defect

Pineapple | Size

       |Firmness

       |    Special_Feature

        | Family

           color

Watermelon | Freshness

          | Heaviness

          | Family

          | Weight

And I want to the following result from the dataframe

idx |Group |Family | Quantity |Quality | variations| Family | Defect
1 |Apple | Fuji | 100
2 |Apple | Granny Smith |20
3 |Apple | Gala | 100
4 |Apple | Honeycrisp | 88
5 |Apple | Brecheche | 60
6 |Apple | McIntosh | 70 7 Apple Gala 44

Right now, I am manually doing a lookup on the group category of the first data frame with the "group Audit " column on the second. Afterward doing a transpose on the audit variation based on the Group Type. Since I am new to Python, is there any way to automate this process? This would save a lot of time. Suggestions are welcomed.

0 Answers
Related