(Lesson 4 Structured data)IndexError: boolean index did not match indexed array along dimension 0;

Hello,

I am trying to use lesson 4 code on a classification problem
However, I run into Error:
IndexError: boolean index did not match indexed array along dimension 0; dimension is 80000 but corresponding boolean dimension is 97437

My code is following:
################################
import sys

from fastai.structured import *
from fastai.column_data import *
import pandas as pd
from torch.nn import functional as F

path=’~/PycharmProjects/Neural_net_work/venv/’
dtype_dict={‘dectype’:np.int8,
‘grounds’:‘category’,
‘criteria’:‘category’,
‘sbstream’:‘category’,
‘numguys’:‘category’,
‘nation’:‘category’,
‘gender’:‘category’,
‘maritals’:‘category’,
‘cniddist’:‘category’,
‘cobeqnat’:‘category’,
‘sch’:‘category’,
‘fcc’:‘category’,
‘mrground’:‘category’,
‘mrapptyp’:‘category’,
‘apphist’:‘category’,
‘prevdec’:‘category’,
‘mrdec’:‘category’,
‘arrhist’:‘category’,
‘numladvi’:‘category’,
‘haspers’:‘category’,
‘hasspons’:‘category’,
‘hasadvis’:‘category’,
‘adouta’:‘category’,
‘adoutany’:‘category’,
‘limited_5years’:‘category’,
‘has_family_asylum_claim’:‘category’,
‘favour’:‘category’,
‘agegrp’:‘category’,
‘botagegrp’:‘category’,
‘topagegrp’:‘category’,
‘dep’:‘category’,
‘morearrive’:‘category’,
‘travel’:‘category’,
‘within’:‘category’,
‘accYear’:‘category’,
‘accMonth’:‘category’,
‘accWeek’:‘category’,
‘accDay’:‘category’,
‘accDayofweek’:‘category’,
‘accDayofyear’:‘category’,
‘accIs_month_end’:‘category’,
‘accIs_month_start’:‘category’,
‘accIs_quarter_end’:‘category’,
‘accIs_quarter_start’:‘category’,
‘accIs_year_end’:‘category’,
‘accIs_year_start’:‘category’,
‘accElapsed’:‘category’}
data=pd.read_csv(path+“train.csv”,dtype=dtype_dict)
test=pd.read_csv(path+“test.csv”,dtype=dtype_dict)
#print(data.shape),print(test.shape)
#print(data.head(1).T)

combined=pd.concat([data,test])
cats=[c for c in list(dtype_dict.keys()) if c not in [‘dectype’]]

for c in cats:
combined[c]=combined[c].astype(‘category’).cat.codes

#combined.info(memory_usage=‘deep’)
cat_sz=[(c,len(combined[c].unique())) for c in cats]

data=combined[:len(data)]
test=combined[len(data):]

emb_szs=[(c,min(50,(c+1)//2)) for _,c in cat_sz]

#model and training
model=MixedInputModel(emb_szs,n_cont=0,emb_drop=0,out_sz=2,szs=[500],drops=[0.5]).cuda()

bm=BasicModel(model,‘binary_classifier’)

val_idxs=list(range(int(len(data)*0.8),len(data)))

#create balidation set based on time since test set is from future
trn_df,trn_y=data[cats].iloc[:80000],data.dectype[:80000]
val_df,val_y=data[cats].iloc[80000:],data.dectype[80000:]
print(data.describe())
md=ColumnarModelData.from_data_frame(’/tmp’,trn_df,val_df,trn_y.astype(‘int’),val_y(‘int’),cats,128,test_df=test[cats])

#md=ColumnarModelData.from_data_frame(path,val_idxs,data,trn_y.astype(‘int’), cats,128,test_df=test,is_reg=False)
################################################
I am new to neural network, can anyone please help me with the error here?
thank you.