Skip to content

Instantly share code, notes, and snippets.

@geoHeil
Created October 15, 2020 13:20
Show Gist options
  • Save geoHeil/67911bfad9fe079b9a342431448ec4fe to your computer and use it in GitHub Desktop.
Save geoHeil/67911bfad9fe079b9a342431448ec4fe to your computer and use it in GitHub Desktop.
df['device_id'] = df['device_id'].astype(str).apply(lambda x: x.zfill(2))
df = df.sort_values(['device_id'])
d_r = df.reset_index()
a4_dims = (11.7, 8.27)
fig, ax = pyplot.subplots(figsize=a4_dims)
ax = sns.lineplot(x='index', y='metrik_0', style='device_id', hue='device_id', data=d_r, ax=ax)
import matplotlib.dates as mdates
ax.axvspan(*mdates.datestr2num(['2020-01-04 05:00:00', '2020-01-05 16:00:00']), color='gray', alpha=0.2)
ax.axvspan(*mdates.datestr2num(['2020-01-04 15:00:00', '2020-01-05 00:00:00']), color='gray', alpha=0.2)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment