Skip to content

[Enh]: Add support for DataFrame.rows #285

@Priyansh121096

Description

@Priyansh121096

We would like to learn about your use case. For example, if this feature is needed to adopt Narwhals in an open source project, could you please enter the link to it below?

No response

Please describe the purpose of the new feature or describe the problem to solve.

I have a library which accepts a pandas dataframe and serializes it into a list of lists (df.values.tolist()) before processing it further. I would like to make the library work with polars dataframes as well and would like to use narwhals for the same.

Suggest a solution if possible.

For polars, nw.DataFrame.rows() would be the same as pl.DataFrame.rows().
For pandas, nw.DataFrame.rows() would be pd.DataFrame.values.tolist().

If you have tried alternatives, please describe them below.

No response

Would you want to open a pull request?

yes

Additional information that may help us understand your needs.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions