Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def read_from_database(self):
- cnx = mysql.connector.connect(user = 'root', password = 'database',
- host = '127.0.0.1',
- database = 'features_database')
- cursor = cnx.cursor()
- read_query = ("SELECT x, y FROM coord_location ")
- cursor.execute(read_query)
- self.X = np.asarray(cursor.fetchall())
- cursor.close()
- cnx.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement