Hi.
In this video we will learn more about how to summarize our data using
cross up and Pivot table.
I think that most of you are familiar with Pivot Table from Excel and pivot
tables. In Pandas, uh,
work the same way we have to specify on the index, uh,
that will be the rows. Then we have to specify the columns,
a column which we want to summarize and the aggregate function
Here. In this example,
I wanted to see what is the average time of the attack per protocol
and attack category.
We can specify in each of the parameters a list of columns or aggregate
functions as well. Here, for example,
we see the same as in the previous example,
but with added other aggregation metric count.
And by the way,
this way you can set the pandas options on how to display data
frames in Jupyter. Here I have said I want to display the whole data frame.
Another example is the same, uh,
with added source IP to the index.
Panda Cross Up provides you the same functionality as pivot table,
but there is a difference that to the parameters you can pass separate
series. Notice this one.
We have already filtered a series from the data frame, and
here in the pivot table we just specify the column names.
In our next video, we will learn more on how to use, uh, group by, uh,
and aggregate.