import-from-excel

Faster way to read Excel files to pandas dataframe

Faster way to read Excel files to pandas dataframe Question: I have a 14MB Excel file with five worksheets that I’m reading into a Pandas dataframe, and although the code below works, it takes 9 minutes! Does anyone have suggestions for speeding it up? import pandas as pd def OTT_read(xl,site_name): df = pd.read_excel(xl.io,site_name,skiprows=2,parse_dates=0,index_col=0, usecols=[0,1,2],header=None, names=[‘date_time’,’%s_depth’%site_name,’%s_temp’%site_name]) …

Total answers: 7

Generate table schema inspecting Excel(CSV) and import data

Generate table schema inspecting Excel(CSV) and import data Question: How would I go around creating a MYSQL table schema inspecting an Excel(or CSV) file. Are there any ready Python libraries for the task? Column headers would be sanitized to column names. Datatype would be estimated based on the contents of the spreadsheet column. When done, …

Total answers: 5