Why does this basic Dataloader deliver twice the first value in the data, and not the next (first and second)? I need just a simple yield funcionality for the next series value.
What is to change?
Thanks in advance!
class myDataset(Dataset):
>def init(self, csv_file):
>>self.datenwerte = pd.read_csv(csv_file)
>def len(self):
>> return len(self.datenwerte)
>def getitem(self, idx):
>>sample = self.datenwerte.iloc[idx,1]
>>return sample
dataset1=myDataset(‘airline-passengers.csv’)
data_iter1=torch.utils.data.DataLoader(dataset1, batch_size=1, shuffle=False)
inhalte1 = iter(data_iter1).next()
inhalte2 = iter(data_iter1).next()
print(inhalte1,inhalte2)
-> delivers tensor([112]) tensor([112])
-> should: tensor([112]) tensor([118])
data (‘airline-passengers.csv’)
Month  Passengers
0  1949-01         112
1  1949-02         118
2  1949-03         132
3  1949-04         129…