コード例 #1
0
def test_merge_segments():
    """
    """
    trajs = Trajectories(data.brownian_trajs_df())

    trajs.reset_index(inplace=True)
    trajs.loc[15, ['label']] = 88
    trajs.loc[20, ['label']] = 88
    trajs.set_index(['t_stamp', 'label'], inplace=True)

    new_trajs = trajs.merge_segments([0, 88], inplace=False)

    assert_array_almost_equal(trajs.values, new_trajs.values)

    trajs = Trajectories(data.brownian_trajs_df())
    good_trajs = trajs.copy()

    trajs.reset_index(inplace=True)
    trajs.loc[15, ['label']] = 88
    trajs.loc[20, ['label']] = 88
    trajs.set_index(['t_stamp', 'label'], inplace=True)

    trajs.merge_segments([0, 88], inplace=True)

    assert_array_almost_equal(trajs.values, good_trajs.values)
コード例 #2
0
def test_merge_segments():
    """
    """
    trajs = Trajectories(data.brownian_trajs_df())

    trajs.reset_index(inplace=True)
    trajs.loc[15, ['label']] = 88
    trajs.loc[20, ['label']] = 88
    trajs.set_index(['t_stamp', 'label'], inplace=True)

    new_trajs = trajs.merge_segments([0, 88], inplace=False)

    assert_array_almost_equal(trajs.values, new_trajs.values)

    trajs = Trajectories(data.brownian_trajs_df())
    good_trajs = trajs.copy()

    trajs.reset_index(inplace=True)
    trajs.loc[15, ['label']] = 88
    trajs.loc[20, ['label']] = 88
    trajs.set_index(['t_stamp', 'label'], inplace=True)

    trajs.merge_segments([0, 88], inplace=True)

    assert_array_almost_equal(trajs.values, good_trajs.values)
コード例 #3
0
def test_copy():
    trajs = data.brownian_trajs_df()
    trajs = Trajectories(trajs)

    assert isinstance(trajs.copy(), Trajectories)
コード例 #4
0
def test_copy():
    trajs = data.brownian_trajs_df()
    trajs = Trajectories(trajs)

    assert isinstance(trajs.copy(), Trajectories)