bodo.pandas.BodoSeries.sort_values¶
BodoSeries.sort_values(
self,
*,
axis: Axis = 0,
ascending: bool = True,
inplace: bool = False,
kind: SortKind = "quicksort",
na_position: str = "last",
ignore_index: bool = False,
key: ValueKeyFunc | None = None,
) -> BodoSeries
Parameters
-
ascending : bool, default True: If True, sort values in ascending order, otherwise descending.
-
na_position: str, default 'last': Argument ‘first’ puts NaNs at the beginning, ‘last’ puts NaNs at the end.
-
All other parameters will trigger a fallback to
pandas.Series.sort_values
if a non-default value is provided. Returns
-
BodoSeries
Example
import bodo.pandas as bd
bdf = bd.DataFrame(
{
"A": bd.array([1, 2, 3, 7] * 3, "Int64"),
"B": ["A1", "B1", "C1", "Abc"] * 3,
"C": bd.array([4, 5, 6, -1] * 3, "Int64"),
}
)
sa = bdf["A"]
sa_sorted = sa.sort_values(ascending=False)
print(sa_sorted)
Output: