Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import psycopg2
- import struct
- import array
- import matplotlib.pyplot as plt
- import numpy as np
- conn = psycopg2.connect(host="127.0.0.1",database="TPAS", user="postgres", password="pass")
- cur = conn.cursor()
- cur.execute("SELECT * FROM muestraraw")
- print("The number of parts: ", cur.rowcount)
- row = cur.fetchone()
- lista = []
- while row is not None:
- lista.append(list(row)[10])
- row = cur.fetchone()
- cur.close()
- conn.close()
- arr = lista[1]
- arrb = arr.tobytes()
- array = []
- print (len(arrb))
- for tx in arrb:
- array.append(tx)
- #array = np.array(array)
- #print (array)
- plt.plot(array)
- plt.show()
- #print (arr.tobytes())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement