Iam working using JSON files, the structure of the file is :
{“data”: [{
“ID”:…,
“SensorName”:… ,
“DigitalValue”: …,
“AnalogValue”:… ,
“SchematicName”:…,
“Pin”:…,
“Enable”:…,
“TimeStamp”:…,
}]}
each file is made of many structure like the one above I was wondering how to write a custumized dataset for pythorch using this I get errors:
class JsonDataset(IterableDataset):
def init(self, files):
self.files = files
self.label=label
print('self files ',self.files)
input()
def __len__(self):
    
    return ()
         
def __getitem__(self, idx):
    print('get item hello')
    input()
    data = []
    for k, v in idx['data'][0].items():
        print('v is ',v)
        print()
        print('k is ',k)
        input()
        if type(v) == str:
            # convert it into int or float
            v=int(v)
            data.append(v)
            # and append into data
            
            
        else:
            
            data.append(v)
           
            
            
    torch_data = torch.Tensor(data)
    label=Y
    input()

thanks