Hi,
I am having trouble getting the below code to work. Basically, I have another dataframe (results_df) that has a number of columns, indexed by numbers (0, 1, ..., 971): y, x, pvalue, tstat, etc.
I want to test if pvalue < 0.05, add the corresponding x to a new dataframe indexed by numbers (0, 1, 2, etc). Can anybody help? Much appreciated, thanks!
i=0
coint_tickers = pd.DataFrame()
for x in range(len(results_df)):
if results_df['pvalue'][i] < 0.05:
coint_tickers[i] = results_df['x'][i]
#print results_df['x'][i]
i=i+1