I have a data in this form
storage display value
variable name type format label variable label
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ID_farmer float %9.0g group(CONGLOMERADO NSELUA UA)
Crop_class str16 %16s Crop classification
class_ID int %16.0g class_ID group(Crop_class)
Class_value float %9.0g
farmer_tot float %9.0g
How do I reshape it into something like this
ID_farmer | Crop_class | class_ID | Class_value | farmer_tot |
1 | cereals | cereals | ||
1 | forage | forage | ||
1 | fruit_tree | fruit_tree | 200 | 680 |
1 | hoticulture crop | hoticulture crop | ||
1 | industrial crop | industrial crop | ||
1 | legumes crop | legumes crop | ||
1 | other crop | other crop | ||
1 | root crop | root crop | 480 | 680 |
2 | cereals | cereals | 1590 | 4130 |
2 | forage | forage | ||
2 | fruit_tree | fruit_tree | 540 | 4130 |
2 | hoticulture crop | hoticulture crop | ||
2 | industrial crop | industrial crop | ||
2 | legumes crop | legumes crop | ||
2 | other crop | other crop | ||
2 | root crop | root crop | 2000 | 4130 |
5 | cereals | cereals | 3675 | 3675 |
5 | forage | forage | ||
5 | fruit_tree | fruit_tree | ||
5 | hoticulture crop | hoticulture crop |
storage display value
variable name type format label variable label
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ID_farmer float %9.0g group(CONGLOMERADO NSELUA UA)
Crop_class str16 %16s Crop classification
class_ID int %16.0g class_ID group(Crop_class)
Class_value float %9.0g
farmer_tot float %9.0g
How do I reshape it into something like this
ID_farmer | Crop_class | cereals | forage | fruit_tree | hoticulture crop | industrial crop | legumes crop | other crop | root crop | farmer_tot |
1 | 200 | 480 | 680 | |||||||
2 | 150 | 540 | 2000 | 4130 | ||||||
5 | 3675 | 3675 |
Comment