You can do it with apply
:
import numpy as np
g = df.groupby('c')['l1','l2'].apply(lambda x: list(np.unique(x)))
More Related Contents:
- Convert DataFrame column type from string to datetime
- How to apply a function to two columns of Pandas dataframe
- How to convert an XML file to nice pandas dataframe?
- Dynamically evaluate an expression from a formula in Pandas
- df.append() is not appending to the DataFrame
- How to get rid of “Unnamed: 0” column in a pandas DataFrame read in from CSV file?
- Pandas groupby mean – into a dataframe?
- Load data from txt with pandas
- Add Leading Zeros to Strings in Pandas Dataframe
- Progress indicator during pandas operations
- pandas groupby without turning grouped by column into index
- Coloring Cells in Pandas
- How to import data from mongodb to pandas?
- How to group a pandas dataframe by a defined time interval?
- How to convert a Scikit-learn dataset to a Pandas dataset
- How to sort a Pandas DataFrame by index?
- pandas applying regex to replace values
- pandas two dataframe cross join [duplicate]
- Redefining the Index in a Pandas DataFrame object
- pandas .plot() x-axis tick frequency — how can I show more ticks?
- module ‘pandas’ has no attribute ‘rolling_mean’
- Group dataframe and get sum AND count?
- Replace value for a selected cell in pandas DataFrame without using index
- Anti-Join Pandas
- Get first row of dataframe in Python Pandas based on criteria
- Get mapping of categorical variables in pandas
- Drop rows on multiple conditions in pandas dataframe
- Convert pandas DataFrame into list of lists [duplicate]
- Got continuous is not supported error in RandomForestRegressor
- Can I perform dynamic cumsum of rows in pandas?