Summary
In this chapter, we extensively discussed the groupby
operation as implemented in Danfo.js. We discussed grouping data and mentioned that at the moment, Danfo.js only supports grouping by single and double columns; there is a plan to make this more flexible in coming versions of Danfo.js. We also showed how to iterate through grouped data and access group keys and their associated grouped data. We looked at how to obtain grouped data associated with a group key without looping.
We also saw how the .apply
method gives us the ability to create custom data aggregation functions for our grouped data, and finally, we demonstrated how to perform different aggregation functions on different columns of grouped data at the same time.
This chapter equipped us with the knowledge of grouping our data, and more essentially, it introduced us to the internals of Danfo.js. With this, we can reshape the groupby
method to our desired taste and have the ability to contribute to Danfo.js...