Skip to content

Instantly share code, notes, and snippets.

@LosantGists
Last active July 23, 2021 19:16
Show Gist options
  • Select an option

  • Save LosantGists/92ef517fe1877a907eb7924ba8757147 to your computer and use it in GitHub Desktop.

Select an option

Save LosantGists/92ef517fe1877a907eb7924ba8757147 to your computer and use it in GitHub Desktop.
Automating Unit Tests (6) 7.23.21
def build_battery_history(values, device_id="60df87b4be3fc900069dac1f", start_time=1600000000000):
id_array = [device_id] * len(values)
timestamp_array = map(lambda t: start_time + t * 10000, range(len(values)))
return pd.DataFrame({
"ID": pd.Series(id_array),
"battery": pd.Series(values, dtype="int64"),
"Timestamp": pd.Series(timestamp_array, dtype="int64")
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment