text_plain_output_1.png image_output_1.png
import matplotlib.pylab as pylab

import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import matplotlib.pylab as pylab
params = {'legend.fontsize': 'x-large', 'figure.figsize': (15, 10), 'axes.labelsize': 'x-large', 'axes.titlesize': 'x-large', 'xtick.labelsize': 'x-large', 'ytick.labelsize': 'x-large'}
pylab.rcParams.update(params)
plt.style.use('dark_background')
df = pd.read_csv('../input/step-count-from-phone-app/data.csv')
df['start'] = pd.to_datetime(df['start'])
df['end'] = pd.to_datetime(df['end'])

df_temp = df.copy()
df_temp['start'] = df_temp['start'].dt.round('24h')
df_temp = df_temp.groupby(['user_id', 'start']).sum().reset_index()

g = sns.barplot(data=df.groupby([df.start.dt.year, 'user_id']).mean().reset_index(), x='start', y='value', hue='user_id')
plt.xlabel('Year')
plt.ylabel('Avg steps number')
plt.title('Average steps number by year')