code: def add_data_to_df(self, data: np.array):
          
  
          col_names = ['high_p', 'low_p', 'open_p', 'close_p', 'volume', 'oi']
  
          data = np.array(data).reshape(-1, len(col_names) + 1)
          df = pd.DataFrame(data=data[:, 1:], index=data[:, 0],
                            columns=col_names)
  
          df.index = pd.to_datetime(df.index)
  
          # Sort the dataframe based on ascending dates.
          df.sort_index(ascending=True, inplace=True)
  
          # Convert dataframe columns to float and ints.
          df[['high_p', 'low_p', 'open_p', 'close_p']] = df[
              ['high_p', 'low_p', 'open_p', 'close_p']].astype(float)
          df[['volume', 'oi']] = df[['volume', 'oi']].astype(int)
  
          if self._ndf.empty:
              self._ndf = df
          else:
              self._ndf = self._ndf.append(df)
docs: Build Pandas Dataframe in memory