one line solution
\npythondata []\nimport pandas as pd\n\ndef pivotTable(weather: pd.DataFrame) -> pd.DataFrame:\n    table = pd.pivot_table(weather, values=\'temperature\', inde
\n```pythondata []\nimport pandas as pd\n\ndef pivotTable(weather: pd.DataFrame) -> pd.DataFrame:\n    table = pd.pivot_table(weather, values=\'temperature\', index=[\'month\'],\n                       columns=[\'city\'], aggfunc="sum")\n    return table\n```
['Pandas']