0
I made a code that takes data from the comic to generate a graph with the matplotlib, but the data in the comic is as varchar and for the creation of the data it must be in the format float. How can one make the conversion?
# -*- coding: utf-8 -*-
import MySQLdb as mdb
import matplotlib.pyplot as plt
print(plt)
con = mdb.connect('localhost', 'root', '123456', 'testdb');
null = None
with con:
cur = con.cursor()
d = cur.execute("SELECT Ping FROM Pings WHERE Enderecos = 'www.peplink.com'")
d = cur.fetchall()
plt.plot(d)
plt.title("Peplink")
plt.show()
No, because he presents himself later as "78.5 ms"
– Yúlia