title: Strange assert/comparison behavior with single PeriodIndex object from Pandas series
body: <p>When trying to make a comparison with a PeriodIndex type object and subsequently writing a few data tests involving them I came across some confusing behavior.  Any clarification on why there is a difference in the way these statements are processed would be great.</p>
  <pre><code>&gt; d = {'col1': ['a','b','c'], 'col2':pd.PeriodIndex(data=['2022-01-01','2021-05-01','2020-10-01'], freq='Q')}
  &gt; tdf = pd.DataFrame.from_records(data=d)
  
  &gt; print(tdf.dtypes)
  col1           object
  col2    period[Q-DEC]
  dtype: object
  
  &gt; print(tdf.col2[0])
  2022Q1
  &gt; print(tdf.col2[0] == '2022Q1')
  False
  &gt; print(tdf[tdf.col1 == 'a'].col2 == '2022Q1')
  0    True
  
  &gt; assert tdf[tdf.col1 == 'a'].col2 == '2022Q1', 'doesnt match'
  ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
  
  &gt; assert all(tdf[tdf.col1 == 'a'].col2 == '2022Q1'), 'doesnt match'
  # Passes no big deal
  </code></pre>
  <p>Accessing the same object in a different way makes the comparison go from False to True, and then wrapping the single assertion in <code>all</code> helps it to pass.</p>