#NEWLINE# def create_minute_df_for_asset( env , start_dt , end_dt , interval = 1 , start_val = 1 , minute_blacklist = None ) : #NEWLINE# #INDENT# asset_minutes = env . minutes_for_days_in_range ( start_dt , end_dt ) #NEWLINE# minutes_count = len ( asset_minutes ) #NEWLINE# minutes_arr = np . array ( range ( start_val , ( start_val + minutes_count ) ) ) #NEWLINE# df = pd . DataFrame ( { #NEWLINE# #INDENT# 'open' : ( minutes_arr + 1 ) , #NEWLINE# 'high' : ( minutes_arr + 2 ) , #NEWLINE# 'low' : ( minutes_arr - 1 ) , #NEWLINE# 'close' : minutes_arr , #NEWLINE# 'volume' : ( 100 * minutes_arr ) , #NEWLINE# #UNINDENT# } , index = asset_minutes ) #NEWLINE# if ( interval > 1 ) : #NEWLINE# #INDENT# counter = 0 #NEWLINE# while ( counter < len ( minutes_arr ) ) : #NEWLINE# #INDENT# df [ start_dt : ( ( counter + interval ) - 1 ) ] = 0 #NEWLINE# counter += interval #NEWLINE# #UNINDENT# #UNINDENT# if ( minute_blacklist is not None ) : #NEWLINE# #INDENT# for minute in minute_blacklist : #NEWLINE# #INDENT# df . loc [ minute ] = 0 #NEWLINE# #UNINDENT# #UNINDENT# return df