pandas-ai
If, like me, you are not a data expert, you might like to know that the pandas module has a little brother: pandas-ai.
so whereas with pandas, you analyse your data like so:
```
males = df[df["Sex"] == "male"]
male_survival = males["Survived"].sum()/len(males)
females = df[df["Sex"] == "female"]
female_survival = females["Survived"].sum()/len(females)
female_survival/male_survival
```
to find out how much more likely females were to survive the Titanic disaster (fyi, 3.93 times).
with pandas.ai, you would ask your friendly LLM directly:
```
pandas_ai.chat("what sex was most likely to have survived? how much more likely?")
```
'The sex most likely to have survived is female, and they were 3.93 times more likely to have survived compared to the other sex.'
7
2 comments
Marco Bottaro
7
pandas-ai
Data Alchemy
skool.com/data-alchemy
Your Community to Master the Fundamentals of Working with Data and AI — by Datalumina®
Leaderboard (30-day)
Powered by