from sqlalchemy import create_engine
import pymysql
import pandas as pd
import numpy as np

pymysql.install_as_MySQLdb()
engine = create_engine("mysql+mysqldb://root:"+"swhacademy!"+"@192.168.0.41/market", encoding='utf-8')
conn = engine.connect()

df = pd.read_sql_query("select * from stock_news limit 5", conn)
df = df['contents']
df.name = "뉴스기사"
df.index.name = 'ID'
print(df.index)
#print(df.values)
print(df)