docstr: Test get_clean_factor_and_forward_returns with a daily factor
  on a business day calendar
docstr_tok: ["Test","get_clean_factor_and_forward_returns","with","a","daily","factor","on","a","business","day","calendar"]
code: def test_get_clean_factor_and_forward_returns_2(self):
      """
      Test get_clean_factor_and_forward_returns with a daily factor
      on a business day calendar
      """
      tickers = ["A", "B", "C", "D", "E", "F"]
  
      factor_groups = {"A": 1, "B": 2, "C": 1, "D": 2, "E": 1, "F": 2}
  
      price_data = [
          [
              1.10**i,
              0.50**i,
              3.00**i,
              0.90**i,
              0.50**i,
              1.00**i,
          ]
          for i in range(1, 7)
      ]  # 6 days = 3 + 3 fwd returns
  
      factor_data = [
          [3, 4, 2, 1, nan, nan],
          [3, nan, nan, 1, 4, 2],
          [3, 4, 2, 1, nan, nan],
      ]  # 3 days
  
      start = "2017-1-12"
      factor_end = "2017-1-16"
      price_end = "2017-1-19"  # 3D fwd returns
  
      price_index = date_range(start=start, end=price_end, freq="B")
      price_index.name = "date"
      prices = DataFrame(
          index=price_index, columns=tickers, data=price_data
      )
  
      factor_index = date_range(start=start, end=factor_end, freq="B")
      factor_index.name = "date"
      factor = DataFrame(
          index=factor_index, columns=tickers, data=factor_data
      ).stack()
  
      factor_data = get_clean_factor_and_forward_returns(
          factor,
          prices,
          groupby=factor_groups,
          quantiles=4,
          periods=(1, 2, 3),
      )
  
      expected_idx = factor.index.rename(["date", "asset"])
      expected_cols = [
          "1D",
          "2D",
          "3D",
          "factor",
          "group",
          "factor_quantile",
      ]
      expected_data = [
          [0.1, 0.21, 0.331, 3.0, 1, 3],
          [-0.5, -0.75, -0.875, 4.0, 2, 4],
          [2.0, 8.00, 26.000, 2.0, 1, 2],
          [-0.1, -0.19, -0.271, 1.0, 2, 1],
          [0.1, 0.21, 0.331, 3.0, 1, 3],
          [-0.1, -0.19, -0.271, 1.0, 2, 1],
          [-0.5, -0.75, -0.875, 4.0, 1, 4],
          [0.0, 0.00, 0.000, 2.0, 2, 2],
          [0.1, 0.21, 0.331, 3.0, 1, 3],
          [-0.5, -0.75, -0.875, 4.0, 2, 4],
          [2.0, 8.00, 26.000, 2.0, 1, 2],
          [-0.1, -0.19, -0.271, 1.0, 2, 1],
      ]
      expected = DataFrame(
          index=expected_idx, columns=expected_cols, data=expected_data
      )
      expected["group"] = expected["group"].astype("category")
  
      assert_frame_equal(factor_data, expected)
  
file_path: alphalens/alphalens/tests/test_utils.py
imports: from __future__ import division
  from unittest import TestCase
  from parameterized import parameterized
  from numpy import nan
  from pandas import Series, DataFrame, date_range, MultiIndex, Timedelta, Timestamp, concat
  from pandas.util.testing import assert_frame_equal, assert_series_equal
  from ..utils import get_clean_factor_and_forward_returns, compute_forward_returns, quantize_factor
label_desc: Use image node_id 6 for calling the UtilsTestCase obj's underlying member method code with example usage: obj.test_get_clean_factor_and_forward_returns_2() without return types