Have a numpy_array
like below which I calculated based on some conditions on main_df dataframes price variable
2021-06-09 14:55:00 0
2021-06-09 15:00:00 1
2021-06-09 15:05:00 0
2021-06-09 15:10:00 -1
#saves the above numpy array in a study_name_1_result variable study_name_1_result=above_numpy_array
Have a main_df
like this that I need to add values to
price positive_studies negative_studies
date_time
2021-06-09 14:55:00 100 [] []
2021-06-09 15:00:00 110 [] []
2021-06-09 15:05:00 222 [] []
2021-06-09 15:10:00 332 [] []
I tried like this to add studies to appropriate columns
#'study_name_1' is the name of the study I used to generate the study_name_1_results variable(numpy array)
numpy.where((study_name_1_result > 0),main_df['positive_studies'].append('study_name_1'))
numpy.where((study_name_1_result < 0),main_df['negative_studies'].append('study_name_1'))
But getting error TypeError: cannot concatenate object of type '<class 'str'>'; only Series and DataFrame objs are valid
My expected output is like below
price positive_studies negative_studies
date_time
2021-06-09 14:55:00 100 [] []
2021-06-09 15:00:00 110 ['study_name_1'] []
2021-06-09 15:05:00 222 [] []
2021-06-09 15:10:00 332 [] ['study_name_1']
Could someone tell me what am doing wrong here??