title: Check all possible labels (y) of an array or Dataframe
body: <p>I have a dataset with 12k samples, which each sample has one label y. How can I extract all possible outputs from these 12k samples? (the outputs can vary from 50 to 60 different values... I don't know).</p>
  
  <p>Is there a built-in function for this? A way different than using a for on all samples like 60 times.... I don't know you but this loss of processment triggers me upset and makes the code so ugly.</p>
  
  <p>Note: I don't want a list with the y of each sample, I just want to know how much y I have so I can set the 'number of outputs' of my learning model.</p>
  
  <p>I solved it with:</p>
  
  <pre><code>    notfound = 0
      n_outputs = 0
      for num in range(1,80):
          temp = n_outputs
          try:
              for i in range(len(y)):
                  if int(y[i]) == num:
                      n_outputs += 1
                      raise StopIteration
  
          except StopIteration:
              pass
          if temp == n_outputs:
              notfound += 1
          if notfound == 3:
              break
  
      print(n_outputs)
  </code></pre>
  
  <p>But is there another way?</p>