Pandas Crosstab Explained
Posted by Chris Moffitt in articles
Pandas offers several options for grouping and summarizing data but this variety of
options can be a blessing and a curse. These approaches are all powerful data
analysis tools but it can be confusing to know whether to use a
groupby
, pivot_table
or crosstab
to build a summary table.
Since I have previously covered pivot_tables, this article will discuss the
pandas crosstab
function, explain its usage and illustrate how it can be
used to quickly summarize data. My goal is to have this article be a resource that
you can bookmark and refer to when you need to remind yourself what you can do
with the crosstab
function.