Closed
Description
x=pd.DataFrame([[1,'John P. Doe'],[2,'Jane Dove'],[1,'John P. Doe']],
columns=['person_id','person_name'])
x['person_name']=pd.Categorical(x.person_name) # doing this breaks transform
g=x.groupby(['person_id'])
g.transform(lambda x:x)
AttributeError: 'ObjectBlock' object has no attribute '_holder'
using drop_duplicates
inside apply (I often need this):
g.apply(lambda x: x.drop_duplicates('person_name'))
SystemError: numpy/core/src/multiarray/iterators.c:370: bad argument to internal function
and iloc is not what I expected:
x.iloc[0].person_name # ok
x.person_name.iloc[0] # err
TypeError: Argument 'arr' has incorrect type (expected numpy.ndarray, got Series)