Skip to content
This repository was archived by the owner on Apr 10, 2024. It is now read-only.
This repository was archived by the owner on Apr 10, 2024. It is now read-only.

monad-ish API #78

Open
Open
@sleak-lbl

Description

@sleak-lbl

A pattern that has repeatedly caught me out is stringing operations together like: df['myfield'].notnull().unique() .. the error here is that notnull() returns a mask rather than a slice of the dataframe or series. Having most operations return a dataframe/series with the same signature, and ones that don't being more obvious, would probably ease the learning curve and help to avoid some user code errors, eg:
df['myfield'].notnull() # returns a series of same dtype as df['myfield'], with the N/A rows dropped
df['myfield'].is_notnull() # returns a series of dtype boolean to use as a mask

"monad-ish" because operations generally return an object of the same type.

This would unfortunately cause hard-to-find-in-user-code changes to the API

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions