MCPcopy Create free account
hub / github.com/dask/dask / test_squeeze

Function test_squeeze

dask/dataframe/dask_expr/tests/test_collection.py:276–298  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

274
275
276def test_squeeze():
277 df = pd.DataFrame({"x": [1, 3, 6]})
278 df2 = pd.DataFrame({"x": [0]})
279 s = pd.Series({"test": 0, "b": 100})
280
281 ddf = from_pandas(df, 3)
282 ddf2 = from_pandas(df2, 3)
283 ds = from_pandas(s, 2)
284
285 assert_eq(df.squeeze(), ddf.squeeze())
286 assert_eq(pd.Series([0], name="x"), ddf2.squeeze())
287 assert_eq(ds.squeeze(), s.squeeze())
288
289 with pytest.raises(
290 NotImplementedError, match=f"{type(ddf)} does not support squeeze along axis 0"
291 ):
292 ddf.squeeze(axis=0)
293
294 with pytest.raises(ValueError, match=f"No axis {2} for object type {type(ddf)}"):
295 ddf.squeeze(axis=2)
296
297 with pytest.raises(ValueError, match=f"No axis test for object type {type(ddf)}"):
298 ddf.squeeze(axis="test")
299
300
301def test_filter_pushdown_reducer_in_predicate():

Callers

nothing calls this directly

Calls 4

squeezeMethod · 0.95
squeezeMethod · 0.95
from_pandasFunction · 0.90
assert_eqFunction · 0.90

Tested by

no test coverage detected