Created
April 9, 2020 14:23
-
-
Save sergiolucero/583e55a19dec25242971ad89c2634f07 to your computer and use it in GitHub Desktop.
Plotting total travel from my Google Location History
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
import pandas as pd | |
import seaborn as sns | |
import matplotlib.pyplot as plt | |
df = pd.read_csv('mobility.csv', encoding='latin-1') # this comes from Google Takeout in JSON format | |
fig, ax = plt.subplots(1, figsize=(24,18)) | |
p = sns.heatmap(df[df.año>2013].pivot_table(index='año', columns='mes', values='distancia'), | |
annot=True, annot_kws = {'size':14, 'weight': 'bold'}, fmt='.1f', cmap='brg') | |
_ = p.set_title('Kilómetros recorridos por Sergio Lucero al mes (según Google Maps)', size=24) | |
plt.savefig('mobility.png', dpi=720) |
Author
sergiolucero
commented
Apr 9, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment