Created
June 16, 2022 16:57
-
-
Save edersonbadeca/5f13689d09e5926528f81e9fa075c26b to your computer and use it in GitHub Desktop.
calculate deploy per hour dora metrics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# This sample code shows how to create a timeseries based on date periods to calculate | |
# the frequency that an event occurs in a hour. | |
# Links: | |
# - https://pandas.pydata.org/docs/reference/api/pandas.date_range.html | |
# - https://pandas.pydata.org/docs/getting_started/intro_tutorials/09_timeseries.html?highlight=resample#resample-a-time-series-to-another-frequency | |
import pandas as pd | |
import numpy as np | |
rng = pd.date_range('1/1/2011', periods=5, freq='60S') | |
ts = pd.Series(np.random.randint(0, 5, len(rng)), index=rng) | |
ts.resample('H').agg(['count']) | |
print('ok') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment