TypeError: 'Dataset' object does not support indexing

Thank you, @DAlolicorn.
Sorry, that was my mistake, I shouldn’t limite shuffled version to first 10 data. I tried,

         self.rand_idx = np.arange(len(self.Test))
         self.Test_shuffeled = self.Test[np.random.shuffle(self.rand_idx)]
          
        def __getitem__(self, index):    
            x1, y1 = self.Test[index]
            x2, y2 = self.Test_shuffeled[index]

it gives this error:

TypeError: list indices must be integers or slices, not NoneType

np.random.shuffle is an in-place operation to shuffle self.rand_idx:

         self.rand_idx = np.arange(len(self.Test))
         np.random.shuffle(self.rand_idx)
          
        def __getitem__(self, index):    
            x1, y1 = self.Test[index]
            x2, y2 = self.Test[self.rand_idx[index]]
1 Like

Got it. Thank you very much for your help @DAlolicorn.