To create summaries by group in Python, you can use the groupby() method from the pandas library.

Assuming you have a pandas DataFrame with columns that you want to group by and summarize, you can use the following syntax:

import pandas as pd
 
# create a pandas DataFrame
df = pd.DataFrame({'Group': ['A', 'B', 'C', 'A', 'B', 'C'],
                   'Value': [1, 2, 3, 4, 5, 6]})
 
# group by the 'Group' column and calculate the mean of the 'Value' column
grouped = df.groupby('Group').mean()
 
print(grouped)

This will group the DataFrame by the 'Group' column and calculate the mean of the 'Value' column for each group. The resulting output will be:

       Value
Group      
A        2.5
B        3.5
C        4.5

You can also use other aggregation functions like sum(), count(), min(), max(), etc. to summarize your data by group.