March 2020
Beginner to intermediate
352 pages
8h 40m
English
The pandas and numpy libraries handle NaN values differently for mathematical operations.
Consider the following example:
ar1 = np.array([100, 200, np.nan, 300])ser1 = pd.Series(ar1)ar1.mean(), ser1.mean()
The output of the preceding code is the following:
(nan, 200.0)
Note the following things:
Let's compute the total quantity of fruits sold by store4:
ser2 = dfx.store4ser2.sum()
The output of the preceding code is as follows:
38.0
Note that store4 has five ...
Read now
Unlock full access