You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/pandas.rst
+18-13Lines changed: 18 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,10 @@ print some summary statistics of its numerical data::
54
54
Ok, so we have information on passenger names, survival (0 or 1), age,
55
55
ticket fare, number of siblings/spouses, etc. With the summary statistics we see that the average age is 29.7 years, maximum ticket price is 512 USD, 38\% of passengers survived, etc.
56
56
57
-
Let's say we're interested in the survival probability of different age groups. With two one-liners, we can find the average age of those who survived or didn't survive, and plot corresponding histograms of the age distribution::
57
+
Let's say we're interested in the survival probability of different
58
+
age groups. With two one-liners, we can find the average age of those
59
+
who survived or didn't survive, and plot corresponding histograms of
60
+
the age distribution (:meth:`pandas.DataFrame.groupby`, :meth:`pandas.DataFrame.hist`)::
58
61
59
62
print(titanic.groupby("Survived")["Age"].mean())
60
63
@@ -89,7 +92,7 @@ What's in a dataframe?
89
92
90
93
As we saw above, pandas dataframes are a powerful tool for working with tabular data.
0 commit comments