Answer the question
In order to leave comments, you need to log in
How to solve a Python problem?
The Yandex Practicum simulator does not miss the seemingly correct solution Tasks:
Group the data by the 'month' column and find the average position in the output by month (level). Display the result of the grouping.
Decision:
import pandas as pd
position = pd.read_csv('/datasets/position.csv')
position['timestamp'] = pd.to_datetime(position['timestamp'], format='%Y-%m-%dT%H:%M:%S')
position['month'] = pd.DatetimeIndex(position['timestamp']).month
print(position.groupby('month')['level'].mean())
Answer the question
In order to leave comments, you need to log in
groupby can group by more than just one column.
Here is an example of a correct function call: df.groupby(['A', 'B']).
Look closely at the difference in the function argument.
Check the pandas version for you and for yandex, they may differ. If everything works locally for you, then they have a bug.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question