pandas.Series.list.len#
- Series.list.len()[源代码]#
返回 Series 中每个列表的长度。
- 返回:
- pandas.Series
每个列表的长度。
参见
str.lenPython built-in function returning the length of an object.
Series.sizeReturns the length of the Series.
StringMethods.lenCompute the length of each element in the Series/Index.
例子
>>> import pyarrow as pa >>> s = pd.Series( ... [ ... [1, 2, 3], ... [3], ... ], ... dtype=pd.ArrowDtype(pa.list_(pa.int64())), ... ) >>> s.list.len() 0 3 1 1 dtype: int32[pyarrow]