Hi,
I have the following tables in my python code.When i try to access the adSuggester['trId'] it works but whereas when i try to use queryToken['qId'] it throws me an keyerror.However this is strange because this key exists in the definition of the table.Please help me to resolve this issue.
Thanks
Traceback (most recent call last):
File "C:\Research Docket\KDD\2012 dataset\hd5Writes\hd5-ch1.py", line 88, in <
module>
queryToken['qId']=trainVals[8]
File "tableExtension.pyx", line 1426, in tables.tableExtension.Row.__setitem__
(tables\tableExtension.c:11735)
File "tableExtension.pyx", line 133, in tables.tableExtension.getNestedFieldCa
che (tables\tableExtension.c:1675)
File "utilsExtension.pyx", line 497, in tables.utilsExtension.getNestedField (
tables\utilsExtension.c:3695)
KeyError: 'no such column: qId'
Closing remaining open files: train_1.h5... done
Below is the python code:
class adSuggester(IsDescription):
trId = UInt32Col(pos=0)
click=UInt16Col(pos=1)
class queryToken(IsDescription):
qId=UInt32Col(pos=0)
qTok=UInt32Col(pos=1)
filename="train.h5"
titleTrain="train_data"
h5file = openFile(filename, mode = "w", title=titleTrain)
root=h5file.root
group = h5file.createGroup("/", 'Data', "kddDataChunk"+str(chunkId))
table = h5file.createTable(group, 'dataset', adSuggester, "DatasetChunk for")
groupQuery=h5file.createGroup("/",'queryGrp')
queryTable=h5file.createTable(groupQuery,'query',queryToken,"Query Table for ")
adSuggester=table.row
queryToken=table.row
adSuggester['trId']=trainVals[0] #works
adSuggester['click']=trainVals[1]
queryToken['qId']=trainVals[3] # doesnot work
queryToken['qTok']=trainVals[4]