Use any Python package necessary to make this program Import two Excel files int
ID: 3815353 • Letter: U
Question
Use any Python package necessary to make this program
Import two Excel files into Python (links would be provided)
Generate a graph off of the values in excel file 'Excel1' (Students Admitted, StudentsAdmitted%, StudentsNotAdmitted%) and import another excel file in Python "File being imported1" if the date matches with the date in 'Excel1' file then represent that in the graph using MatplotLib, Xlrd, Pandas (any Python package can be used to generate a graph)
The output must be a graph that's verstaile and if the date matches in both program that there is a DOT that represents that and also says that in the legend that this is what happpend that day.
Paste the code below as the answer to this question with screenshots proving it worked.
Links :
Excel1.xlsx - https://www.dropbox.com/s/tlh6w9lhakh134i/Excel1.xlsx?dl=0
File being imported1- https://www.dropbox.com/s/3ot1dmkuy89d77w/File%20being%20imported1.xlsx?dl=0
Explanation / Answer
import xlwt
import xlrd
wkbk = xlwt.Workbook()
outsheet = wkbk.add_sheet('Sheet1')
xlsfiles = [r'C:oo.xlsx', r'C:ar.xlsx', r'C:az.xlsx']
outrow_idx = 0
for f in xlsfiles:
insheet = xlrd.open_workbook(f).sheets()[0]
for row_idx in xrange(insheet.nrows):
for col_idx in xrange(insheet.ncols):
outsheet.write(outrow_idx, col_idx,
insheet.cell_value(row_idx, col_idx))
outrow_idx += 1
wkbk.save(r'C:combined.xls')
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.