Skip to content

segmentation fault on groupby #3011

Closed
@debrouwere

Description

@debrouwere
import numpy as np
import pandas as pd
series = pd.Series([np.nan, np.nan, 1, 1, 2, 2, 3, 3, 4, 4])
bins = pd.cut(series.dropna(), 4)
# this works
series.dropna().groupby(bins).mean()
# but this results in: 
# [1]    42448 segmentation fault  python
series.groupby(bins).mean()

So, I can see why trying to group a series with bins based on a different (trimmed) series can't really work and don't consider that to be a bug, but it might be nice if pandas threw a proper error message instead of segfaulting.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions