Skip to content

BUG: groupby.count() on different dtypes seems buggy #8169

Closed
@jreback

Description

@jreback

from SO

something odd going on here:

vals = np.hstack((np.random.randint(0,5,(100,2)), np.random.randint(0,2,(100,2))))
df = pd.DataFrame(vals, columns=['a', 'b', 'c', 'd'])
df[df==2] = np.nan
df2 = df.copy()
df2['a'] = df2['a'].astype('float32')
df2['b'] = df2['b'].astype('float32')
df.groupby(['c', 'd']).count()
df2.groupby(['c','d']).count()

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