Use pivot_table() method
IntuitionApproach'index' attribute takes the rows, 'columns' takes column value and 'values' takes the value for the rowsComplexity
Time complexity:

Space comp
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
'index' attribute takes the rows, 'columns' takes column value and 'values' takes the value for the rows 

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```pythondata []
import pandas as pd

def pivotTable(weather: pd.DataFrame) -> pd.DataFrame:
    return weather.pivot_table(index='month', columns='city', values='temperature')
    
```
['Pandas']