def test_safe_indexing_pandas():
    try:
        import pandas as pd
    except __HOLE__:
        raise SkipTest("Pandas not found")
    X = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
    X_df = pd.DataFrame(X)
    inds = np.array([1, 2])
    X_df_indexed = safe_indexing(X_df, inds)
    X_indexed = safe_indexing(X_df, inds)
    assert_array_equal(np.array(X_df_indexed), X_indexed)
dataset/ETHPy150Open trevorstephens/gplearn/gplearn/skutils/tests/test_utils.py/test_safe_indexing_pandas