docstr: Build Pandas Dataframe in memory
docstr_tok: ["Build","Pandas","Dataframe","in","memory"]
code: def add_data_to_df(self, data: np.array):
      """Build Pandas Dataframe in memory"""
  
      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)
  
file_path: backtrader/contrib/utils/iqfeed-to-influxdb.py
imports: import sys
  import os
  import io
  import socket
  import logging
  import numpy
  import pandas
  import datetime
  import argparse
  from influxdb import DataFrameClient
  from influxdb.exceptions import InfluxDBClientError
label_desc: Use image node_id 5 for calling the IQFeedTool obj's underlying member method code with example usage: obj.add_data_to_df(data) without return types