Shortcuts

torcharrow.DataFrame.median

DataFrame.median()

返回每列非空值的中位数。

示例

>>> import torcharrow as ta
>>> df = ta.dataframe({"a": [1.0,2.0,None,3.0],
                        "b": [5.0, 7.0, None, 9.0]
                        })
>>> df.mean()
index    a    b
-------  ---  ---
    0    2    7
dtype: Struct([Field('a', Float32(nullable=True)), Field('b', Float32(nullable=True))]), count: 1, null_count: 0