[Python] dataframe of pandas returns mysql / Maria DB result mysql / maria DB 쿼리의 결과를 pandas의 dataframe으로 만들기 import pymysql import pandas as pd db = pymysql.connect( host=' ', port= , user=' ', password=' ', db=' ', charset='utf8' ) SQL = "select * from table" df = pd.read_sql(SQL,db) print(df) Python/Python For Analytics 2019.08.08
[Python] Retrieving data from all sheets of Excel file using openpyxl and pandas openpyxl과 pandas를 이용한 엑셀파일의 모든 시트의 데이터 불러오기 import openpyxl import pandas as pd xlsxFile = 'D:\\test\\files.xlsx' sheetList = [] # openpyxl를 이용하여 시트명 가져오기 wb = openpyxl.load_workbook(xlsxFile) for i in wb.get_sheet_names(): sheetList.append(i) # pandas를 이용하여 각 시트별 데이터 가져오기 xlsx = pd.ExcelFile(xlsxFile) for j in sheetList: df = pd.read_excel(xlsx, j) print('%s Sheet의 데이타 입니다.' %j) print(df) print.. Python/Python For Analytics 2018.06.10