Skip to content

Remove list_as_series=True from search_sorted #22058

@coastalwhite

Description

@coastalwhite

Checks

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of Polars.

Reproducible example

import polars as pl
df = pl.DataFrame({ 'a': [1, 2, 3, 4, 5, 6, 7] })

df.select(
    search_sorted = pl.col.a.search_sorted([1, 2]), # returns [0, 1]
    index_of = pl.col.a.index_of([1, 2]) # throws error
)

Log output

Issue description

I think it is strange that search_sorted and index_of show different behavior.

Expected behavior

In my mind, either one should be like the other.

Installed versions

Replace this line with the output of pl.show_versions(). Leave the backticks in place.

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedReady for implementationbreaking pythonChange that breaks backwards compatibility for the Python packagebugSomething isn't workingpythonRelated to Python Polars

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions