Skip to content

Commit 22745d8

Browse files
committed
test: add test for describe method using PyDict input
1 parent 0343837 commit 22745d8

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

python/tests/test_dataframe.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,6 +1870,25 @@ def test_describe(df):
18701870
}
18711871

18721872

1873+
def test_describe_from_pydict(ctx):
1874+
df = ctx.from_pydict({"a": [1, 2, 3], "b": [4, 5, 6], "c": [8, 5, 8]})
1875+
result = df.describe().to_pydict()
1876+
assert result == {
1877+
"describe": [
1878+
"count",
1879+
"null_count",
1880+
"mean",
1881+
"std",
1882+
"min",
1883+
"max",
1884+
"median",
1885+
],
1886+
"a": [3.0, 0.0, 2.0, 1.0, 1.0, 3.0, 2.0],
1887+
"b": [3.0, 0.0, 5.0, 1.0, 4.0, 6.0, 5.0],
1888+
"c": [3.0, 0.0, 7.0, 1.7320508075688772, 5.0, 8.0, 8.0],
1889+
}
1890+
1891+
18731892
def test_describe_mixed_numeric_string():
18741893
ctx = SessionContext()
18751894
batch = pa.RecordBatch.from_arrays(

0 commit comments

Comments
 (0)