title: Python Pandas Using dataframe.stack().value_counts() -- How to get values of counted objects?
body: <p>I have a data frame that in which every row represents a day of the week, and every column represents the serial number of an internet-connected device that failed to communicate with the server on that day.</p>
  
  <p>I am trying to get a Series of serial numbers that have failed to communicate for a full week.</p>
  
  <p>The code block:</p>
  
  <pre><code>counts = df.stack().value_counts()
  seven_day = counts[counts == 7]
  for a in seven_day:
      print(a)
  </code></pre>
  
  <p>The problem is that nothing is printed. What I want is a list of the serial numbers, and not the counts themselves. </p>
  
  <p>This question is a follow-up from: 
  <a href="https://stackoverflow.com/questions/40244094/python-pandas-determine-if-values-in-column-0-are-repeated-in-each-subsequent">Python Pandas -- Determine if Values in Column 0 Are Repeated in Each Subsequent Column</a></p>