docstr: Ingest price data from a CSV file.
  
  Parameters
  ----------
  path: str
  data_frequency: str
  
  Returns
  -------
  list[str]
      A list of potential problems detected during ingestion.
docstr_tok: ["Ingest","price","data","from","a","CSV","file",".","Parameters","--","--","--","--","--","path",":","str","data_frequency",":","str","Returns","--","--","--","-","list","[","str","]","A","list","of","potential","problems","detected","during","ingestion","."]
code: def ingest_csv(
      self,
      path,
      data_frequency,
      empty_rows_behavior="strip",
      duplicates_threshold=100,
  ):
      """
      Ingest price data from a CSV file.
  
      Parameters
      ----------
      path: str
      data_frequency: str
  
      Returns
      -------
      list[str]
          A list of potential problems detected during ingestion.
  
      """
      log.info("ingesting csv file: {}".format(path))
  
      if self.exchange is None:
          # Avoid circular dependencies
          from catalyst.exchange.utils.factory import get_exchange
  
          self.exchange = get_exchange(self.exchange_name)
  
      problems = []
      df = pd.read_csv(
          path,
          header=0,
          sep=",",
          dtype=dict(
              symbol=np.object_,
              last_traded=np.object_,
              open=np.float64,
              high=np.float64,
              low=np.float64,
              close=np.float64,
              volume=np.float64,
          ),
          parse_dates=["last_traded"],
          index_col=None,
      )
      min_start_dt = None
      max_end_dt = None
  
      symbols = df["symbol"].unique()
  
      # Apply the timezone before creating an index for simplicity
      df["last_traded"] = df["last_traded"].dt.tz_localize(pytz.UTC)
      df.set_index(["symbol", "last_traded"], drop=True, inplace=True)
  
      assets = dict()
      for symbol in symbols:
          start_dt = df.index.get_level_values(1).min()
          end_dt = df.index.get_level_values(1).max()
          end_dt_key = "end_{}".format(data_frequency)
  
          market = self.exchange.get_market(symbol)
          if market is None:
              raise ValueError("symbol not available in the exchange.")
  
          params = dict(
              exchange=self.exchange.name,
              data_source="local",
              exchange_symbol=market["id"],
          )
          mixin_market_params(self.exchange_name, params, market)
  
          asset_def = self.exchange.get_asset_def(market, True)
          if asset_def is not None:
              params["symbol"] = asset_def["symbol"]
  
              params["start_date"] = (
                  asset_def["start_date"]
                  if asset_def["start_date"] < start_dt
                  else start_dt
              )
  
              params["end_date"] = (
                  asset_def[end_dt_key]
                  if asset_def[end_dt_key] > end_dt
                  else end_dt
              )
  
              params["end_daily"] = (
                  end_dt
                  if data_frequency == "daily"
                  else asset_def["end_daily"]
              )
  
              params["end_minute"] = (
                  end_dt
                  if data_frequency == "minute"
                  else asset_def["end_minute"]
              )
  
          else:
              params["symbol"] = get_catalyst_symbol(market)
  
              params["end_daily"] = (
                  end_dt if data_frequency == "daily" else "N/A"
              )
              params["end_minute"] = (
                  end_dt if data_frequency == "minute" else "N/A"
              )
  
          if min_start_dt is None or start_dt < min_start_dt:
              min_start_dt = start_dt
  
          if max_end_dt is None or end_dt > max_end_dt:
              max_end_dt = end_dt
  
          asset = TradingPair(**params)
          assets[market["id"]] = asset
  
      save_exchange_symbols(self.exchange_name, assets, True)
  
      writer = self.get_writer(
          start_dt=min_start_dt.replace(hour=00, minute=00),
          end_dt=max_end_dt.replace(hour=23, minute=59),
          data_frequency=data_frequency,
      )
  
      for symbol in assets:
          # here the symbol is the market['id']
          asset = assets[symbol]
          ohlcv_df = df.loc[
              (df.index.get_level_values(0) == asset.symbol)
          ]  # type: pd.DataFrame
          ohlcv_df.index = ohlcv_df.index.droplevel(0)
  
          period_start = start_dt.replace(hour=00, minute=00)
          period_end = end_dt.replace(hour=23, minute=59)
          periods = self.get_calendar_periods_range(
              period_start, period_end, data_frequency
          )
  
          # We're not really resampling but ensuring that each frame
          # contains data
          ohlcv_df = ohlcv_df.reindex(periods, method="ffill")
          ohlcv_df["volume"] = ohlcv_df["volume"].fillna(0)
  
          problems += self.ingest_df(
              ohlcv_df=ohlcv_df,
              data_frequency=data_frequency,
              asset=asset,
              writer=writer,
              empty_rows_behavior=empty_rows_behavior,
              duplicates_threshold=duplicates_threshold,
          )
      return filter(partial(is_not, None), problems)
  
imports: import os
  import shutil
  from datetime import timedelta
  from functools import partial
  from itertools import chain
  from operator import is_not
  import numpy
  import pandas
  import pytz
  from catalyst import get_calendar
  from catalyst.assets._assets import TradingPair
  from catalyst.constants import DATE_TIME_FORMAT, AUTO_INGEST
  from catalyst.constants import LOG_LEVEL
  from catalyst.data.minute_bars import BcolzMinuteOverlappingData, BcolzMinuteBarMetadata
  from catalyst.exchange.exchange_bcolz import BcolzExchangeBarReader, BcolzExchangeBarWriter
  from catalyst.exchange.exchange_errors import EmptyValuesInBundleError, TempBundleNotFoundError, NoDataAvailableOnExchange, PricingDataNotLoadedError, DataCorruptionError, PricingDataValueError
  from catalyst.exchange.utils.bundle_utils import range_in_bundle, get_bcolz_chunk, get_df_from_arrays, get_assets
  from catalyst.exchange.utils.datetime_utils import get_start_dt, get_period_label, get_month_start_end, get_year_start_end
  from catalyst.exchange.utils.exchange_utils import get_exchange_folder, save_exchange_symbols, mixin_market_params, get_catalyst_symbol
  from catalyst.utils.cli import maybe_show_progress
  from catalyst.utils.paths import ensure_directory
  from logbook import Logger
  from pytz import UTC
  from six import itervalues
label_desc: Use image node_id 15 for calling the ExchangeBundle obj's underlying member method code with example usage: obj.ingest_csv(path, data_frequency, empty_rows_behavior, duplicates_threshold) and returns: filter