Skip to content

Usage of 'limit' keyword when filling with a value #10002

Closed
@jorisvandenbossche

Description

@jorisvandenbossche

From SO: http://stackoverflow.com/questions/29906512/pandas-variation-on-filling-nan-whats-an-elegant-and-pythonic-way-to-do-thi/29906743?noredirect=1#29906743

When doing df.fillna(10, limit=2) what is limit=2 doing?

The docstring says:

limit : int, default None
Maximum size gap to forward or backward fill

But this only explains for filling with a method, not for filling with a value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions