Skip to content

Instantly share code, notes, and snippets.

View brettpetch's full-sized avatar
🌥️
Call me Cloudflare because I'm Always Online™

Brett Petch brettpetch

🌥️
Call me Cloudflare because I'm Always Online™
  • Canada
  • 05:30 (UTC -04:00)
View GitHub Profile
@brettpetch
brettpetch / pandasgraphing_2120_a1.py
Last active December 1, 2019 23:17
How to graph from a pandas dataframe
import pandas as pd # Use pandas instead to map the data easily
import matplotlib.pyplot as plt # Use Matplotlib PyPlot to create graph
import numpy as np # Use Numpy to take mean
def all_temp_plot(filename="London_mean_etr_max_etr_min.csv"):
# Note: This will not drop years with incomplete datsets.
# Read CSV, but only 3 columns because no one cares about the other ones
# then group years, then take mean of months and append it to a new column in a new dataframe.
df = pd.read_csv(filename, delimiter=',', usecols=[0, 1, 2],