code: def expected_bar_values_2d(dates, asset_info, colname):
      """
      Return an 2D array containing cls.expected_value(asset_id, date,
      colname) for each date/asset pair in the inputs.
  
      Values before/after an assets lifetime are filled with 0 for volume and
      NaN for price columns.
      """
      if colname == "volume":
          dtype = uint32
          missing = 0
      else:
          dtype = float64
          missing = float("nan")
  
      assets = asset_info.index
  
      data = full((len(dates), len(assets)), missing, dtype=dtype)
      for j, asset in enumerate(assets):
          start = asset_start(asset_info, asset)
          end = asset_end(asset_info, asset)
          for i, date in enumerate(dates):
              # No value expected for dates outside the asset's start/end
              # date.
              if not (start <= date <= end):
                  continue
              data[i, j] = expected_bar_value(asset, date, colname)
      return data
  
imports: from numpy import arange, array, eye, float64, full, iinfo, uint32
  from numpy.random import RandomState
  from pandas import DataFrame, Timestamp
  from six import iteritems
  from sqlite3 import connect
  from .base import PipelineLoader
  from .frame import DataFrameLoader
  from catalyst.data.us_equity_pricing import SQLiteAdjustmentReader, SQLiteAdjustmentWriter, US_EQUITY_PRICING_BCOLZ_COLUMNS
  from catalyst.utils.numpy_utils import bool_dtype, datetime64ns_dtype, float64_dtype, int64_dtype, object_dtype
label_desc: Use image node_id 6 for calling a global function with example usage: expected_bar_values_2d(dates, asset_info, colname) and returns: data