vgrabovets
12/13/2016 - 10:58 AM

runQuery

runQuery

def runQuery(sql, index_col = None):
    import pymysql
    import pandas as pd
    con = pymysql.connect(host='193.187.76.250',
                          user='WWBQ9O',
                          password='08ZN1D',
                          db='megogo2',
                          charset='utf8')        
    movies_q = pd.read_sql(sql, con, index_col = index_col)
    con.close()
    return(movies_q)