Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/gventuri/pandas-ai
Browse files Browse the repository at this point in the history
  • Loading branch information
gventuri committed Jan 27, 2024
2 parents 66b9ba0 + 33ea13b commit 4053dc6
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pandasai/helpers/shortcuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,5 +329,22 @@ def segment_customers(self, features: list, n_clusters: int) -> DataFrameType:
Segment customers with the following features and number of clusters:
features = {features}
n_clusters = {n_clusters}
"""
)

def data_summarization(self) -> DataFrameType:
"""
Do summarization of the data.
Returns:
DataFrameType: The summarized DataFrame.
"""

return self.chat(
"""
Provide the summary in df format
1. For each distinct value :
2. Calculate subtotal of rows
3. Calculate the percentage of the total count for each group
"""
)

0 comments on commit 4053dc6

Please sign in to comment.