548f35f232e13d87d150fa5b5b00ecd2123dc206,linearmodels/tests/panel/test_data.py,,test_string_nonconversion,#,592

Before Change


    t, n = 3, 1000
    string = np.random.choice(["a", "b", "c"], (t, n))
    num = np.random.randn(t, n)
    p = pd.Panel({"a": string, "b": num})
    panel = PanelData(p, var_name="OtherEffect", convert_dummies=False)
    assert is_string_dtype(panel.dataframe["a"].dtype)
    assert np.all(panel.dataframe["a"] == string.T.ravel())

After Change


    t, n = 3, 1000
    string = np.random.choice(["a", "b", "c"], (t, n))
    num = np.random.randn(t, n)
    time = pd.date_range("1-1-2000", periods=t)
    entities = ["entity.{0}".format(i) for i in range(n)]
    p = panel_to_frame(None, items=["a", "b"], major_axis=time, minor_axis=entities,
                       swap=True)
    p["a"] = string.T.ravel()
    p["b"] = num.T.ravel()
    panel = PanelData(p, var_name="OtherEffect", convert_dummies=False)
    assert is_string_dtype(panel.dataframe["a"].dtype)
    assert np.all(panel.dataframe["a"] == string.T.ravel())
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 23

Instances


Project Name: bashtage/linearmodels
Commit Name: 548f35f232e13d87d150fa5b5b00ecd2123dc206
Time: 2018-06-02
Author: kevin.k.sheppard@gmail.com
File Name: linearmodels/tests/panel/test_data.py
Class Name:
Method Name: test_string_nonconversion


Project Name: bashtage/linearmodels
Commit Name: 548f35f232e13d87d150fa5b5b00ecd2123dc206
Time: 2018-06-02
Author: kevin.k.sheppard@gmail.com
File Name: linearmodels/tests/panel/test_data.py
Class Name:
Method Name: test_categorical_conversion


Project Name: bashtage/linearmodels
Commit Name: 548f35f232e13d87d150fa5b5b00ecd2123dc206
Time: 2018-06-02
Author: kevin.k.sheppard@gmail.com
File Name: linearmodels/tests/panel/test_data.py
Class Name:
Method Name: test_string_nonconversion


Project Name: bashtage/linearmodels
Commit Name: 548f35f232e13d87d150fa5b5b00ecd2123dc206
Time: 2018-06-02
Author: kevin.k.sheppard@gmail.com
File Name: linearmodels/tests/panel/test_data.py
Class Name:
Method Name: test_string_conversion