Using mathematical methods on DataFrames

Computations such as sum, mean, and median can be performed with ease on pandas DataFrames using the built-in mathematical methods in the pandas library. Let's make use of a subset of the sales data to explore the mathematical functions and methods in pandas. While applying these mathematical functions, it should be ensured that the selected columns are numeric. The following screenshot shows the data with five rows and three columns, all of which will be used in this section:

Sample sales data
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset