I'm only a novice at coding in python and am having a few issues with dataframes. I have 30 stocks in my universe and wish to assign them each two extra variables a and b (where a will be equal to either 80 or 900 and b will be equal to either 40 or 1500) which will be determined by whether the ROE for that company is above or below 0.3. So far the dataframe is working fine and the ROE variable defined in my code is returning a series of 30 values as expected. I am struggling to understand why I can't seem to define two new series "a" and "b" could please give some guidance, thanks in advance. Here is my attempt at trying to define series a and b.
while n 0.3:
n += 1