Unique ID Column Returns Multiple Values

111 views Asked by At

I have a Koalas data frame that has what I would expect to be a unique ID column ("index") created by resetting the index on a dataframe using breakdf2 = breakdf.reset_index()

I believe I can prove that breakdf2 only has one record for index = 0 using len(breakdf2.loc[breakdf2['index'] == 0]) which returns "1".

However, when I run

for i in range (10):
  print(breakdf2.loc[breakdf2['index'] == 0][['index', 'Primary_dp_margin', 'Sell_dp_margin']])

I get

enter image description here

How is it that I'm getting 2 pairs of values for a seemingly unique identifier "index"?

0

There are 0 answers