Reputation: 97
I have an excel sheet I'm trying to read in python using pandas. It has some vertically merged cells. the problem is **when reading merged cells, Nan is displayed for them after the first cell. **
Here i am reading the first column "Mr. rattandeepanjea"
The output comes like this with Nan for merged cells, note timeslot 11:20-12:45
My code is:
import pandas as pd
xls = pd.ExcelFile("third.xls") #open the file
sheetX = xls.parse(0) #move to sheet number 1
colAneja = sheetX["MR. RATTAN DEEP ANEJA"]
counter = 9 #the counter is just for showing timeslots out of a list
for lecture in colAneja:
print(lisTime[counter%9],": ",lecture)
counter+=1
` I would expect the same values for all merged cells, like in this case:
10:55-11:50 - DS LAB(G2) MCA-1(RDA)
11:50-12:45 - DS LAB(G2) MCA-1(RDA)
Upvotes: 4
Views: 4569