def _make_data_array_helper(bg_df, time_array, value_array, data_gap_start_time, data_gap_end_time, start_index, index, curr, last, num_extra_added, col_one_name, col_two_name, item_str):
new_time = int((bg_df.iloc[index]['created_at'] - bg_df.iloc[start_index]['created_at']) / np.timedelta64(1, 'm'))
new_value = bg_df.iloc[index][col_one_name][col_two_name][item_str]
old_time = time_array[last]
old_value = value_array[last]
#If it is a data gap, store the start and stop time for later removal
if new_time - old_time > MAX_DATA_GAP_MINUTES:
data_gap_start_time.append(old_time)
data_gap_end_time.append(new_time)
#keep track of the curr value before passing into _fill_data_gaps
start_curr = curr
curr = _fill_data_gaps(old_time, new_time, old_value, new_value, time_array, value_array, curr)
#Find the number of extra entries num_extra_added
num_extra_added += curr - start_curr - 1
last = curr - 1
return time_array, value_array, data_gap_start_time, data_gap_end_time, curr, last, num_extra_added
#Function to make the data array for lomb-scargle given the bg_df dataframe, the start_index, the end_index, and the item_str, which is the column that you want to get
#Can put any start and end index as a parameter
评论列表
文章目录