Skip to content

Dataframe.sample() isn't validating frac #27451

Closed
@ddebernardy

Description

@ddebernardy

Minor/trivial bug:

https://github.com/pandas-dev/pandas/blob/master/pandas/core/generic.py#L4960

Shouldn't sample() check that frac is between 0 and 1 somewhere?

Doc improvement suggestion:

Could anyone confirm that replace=True|False means allowing|disallowing sampling the same row more than once?

Methinks the docs could use an update to make what replace does clearer for newcomers - or at least for those who aren't familiar with numpy.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions