One line. Pivot
Intuition\nPivot function in python is extremely powerful and can do many complex operations in pandas.\n\nBut in our case it is very easy to use it. We use col
# Intuition\nPivot [function](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.pivot.html) in python is extremely powerful and can do many complex operations in pandas.\n\nBut in our case it is very easy to use it. We use columns based on cities and values based on temperature.\n\n# Code\n```\nimport pandas as pd\n\ndef pivotTable(df: pd.DataFrame) -> pd.DataFrame:\n  return df.pivot(index=\'month\', columns=\'city\', values=\'temperature\')  \n```
['Pandas']