-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathres_update.py
More file actions
22 lines (18 loc) · 771 Bytes
/
res_update.py
File metadata and controls
22 lines (18 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from pandas import DataFrame
import MySQLdb
db = MySQLdb.connect(host="ec2-52-37-241-124.us-west-2.compute.amazonaws.com", # your host, usually localhost
user="root", # your username
passwd="password", # your password
db="credit_data") # name of the data base
# you must create a Cursor object. It will let
# you execute all the queries you need
cur = db.cursor()
# Use all the SQL you like
cur.execute("insert into credit_data.dummy_credit_predict (dummy) values ('APPROVED')")
#df = DataFrame(cur.fetchall())
# print all the first cell of all the rows
#for row in cur.fetchall():
# for x in range(len(row)):
# print(row[x])
# print("**********************")
db.close()