Advertisement
AlexErin1308

Task №7

Mar 7th, 2024
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | Source Code | 0 0
  1. import pandas as pd
  2.  
  3. position = pd.read_csv('/datasets/position.csv')
  4. position['timestamp'] = pd.to_datetime(
  5.     position['timestamp'], format='%Y-%m-%dT%H:%M:%S'
  6. )
  7. position['month'] = pd.DatetimeIndex(position['timestamp']).month
  8. #print(position.info)
  9. print(position.groupby('month')['level'].mean())#Сгруппируем данные по столбцу 'month' и найдем среднюю позицию в выдаче по месяцам (level)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement