| 52 | ], |
| 53 | ) |
| 54 | def test_resample_apis(df, pdf, api, kwargs): |
| 55 | result = getattr(df.resample("2min", **kwargs), api)() |
| 56 | expected = getattr(pdf.resample("2min", **kwargs), api)() |
| 57 | assert_eq(result, expected) |
| 58 | |
| 59 | # No column output |
| 60 | if api != "size": |
| 61 | result = getattr(df.resample("2min"), api)()["foo"] |
| 62 | expected = getattr(pdf.resample("2min"), api)()["foo"] |
| 63 | assert_eq(result, expected) |
| 64 | |
| 65 | if api != "ohlc": |
| 66 | # ohlc actually gives back a DataFrame, so this doesn't work |
| 67 | q = result.simplify() |
| 68 | eq = getattr(df["foo"].resample("2min"), api)().simplify() |
| 69 | assert q._name == eq._name |
| 70 | |
| 71 | |
| 72 | @pytest.mark.parametrize( |