g2801_2900.s2889_reshape_data_pivot.solution.py Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of leetcode-in-java Show documentation
Show all versions of leetcode-in-java Show documentation
Java-based LeetCode algorithm problem solutions, regularly updated
The newest version!
# #Easy #2023_12_25_Time_416_ms_(99.87%)_Space_61.8_MB_(21.28%)
import pandas as pd
def pivotTable(weather: pd.DataFrame) -> pd.DataFrame:
return weather.pivot(index='month', columns='city', values='temperature')
© 2015 - 2024 Weber Informatics LLC | Privacy Policy