Browse Source

fix bug with random.choice on a string

saleml 2 years ago
parent
commit
13e97f86a1
1 changed files with 1 additions and 1 deletions
  1. 1 1
      gym_minigrid/minigrid.py

+ 1 - 1
gym_minigrid/minigrid.py

@@ -628,7 +628,7 @@ class StringGymSpace(gym.spaces.space.Space):
 
     def sample(self):
         length = np.random.randint(self.min_length, self.max_length)
-        string = ''.join(np.random.choice(self.letters, size=length))
+        string = ''.join(np.random.choice(list(self.letters), size=length))
         return string
 
     def contains(self, x):