Pythonic Solution
IntuitionReorganize the columns and rowsApproachUse the pivot() function to adjsut the dataframeComplexity
Time complexity:
O(n) for the number of rows
Space co
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
Reorganize the columns and rows

# Approach
<!-- Describe your approach to solving the problem. -->
Use the pivot() function to adjsut the dataframe

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

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
O(n + m) for the number of new rows and columns adjusted

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

def pivotTable(weather: pd.DataFrame) -> pd.DataFrame:
    
    result = weather.pivot(index='month', columns='city', values='temperature')
    
    # Return the pivoted DataFrame
    return result
```
['Pandas']