Skip to content

Instantly share code, notes, and snippets.

@felipem775
Created July 26, 2019 07:17
Show Gist options
  • Save felipem775/8af43728cc6229f0b16c777efbed6b20 to your computer and use it in GitHub Desktop.
Save felipem775/8af43728cc6229f0b16c777efbed6b20 to your computer and use it in GitHub Desktop.
from datetime import datetime
import matplotlib.pyplot as plt
fn = "Nivel_Cares_1.csv"
X, Y = [], []
with open(fn) as f:
f.readline() # leer y descartar cabecero
for line in f:
y, x = line.strip().replace(",",".").split(";")
x = datetime.strptime(x, "%Y-%m-%d %H:%M:%S.000")
y = float(y)
X.append(x)
Y.append(y)
plt.figure(figsize=(16,9))
plt.plot(X, Y)
plt.savefig("plot.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment