- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 19.2k
 
Open
Labels
Description
Pandas version checks
-  I have checked that the issue still exists on the latest versions of the docs on 
mainhere 
Location of the documentation
https://pandas.pydata.org/docs/reference/api/pandas.Series.sum.html
Documentation problem
Consider this example from the docs:
>>> idx = pd.MultiIndex.from_arrays(
...     [["warm", "warm", "cold", "cold"], ["dog", "falcon", "fish", "spider"]],
...     names=["blooded", "animal"],
... )
>>> s = pd.Series([4, 2, 0, 8], name="legs", index=idx)
>>> s.sum()The docs indicate that s.sum() is 14.
But at runtime, it is an np.int64:
>>> s.sum()
np.int64(14)But the printed result depends on the backend:
>>> s = pd.Series([4,2,0,8], name="legs", index=idx, dtype="int64[pyarrow]")
>>> s.sum()
14The example results are hard coded in the docs, and are not created by executing the code (as in other doc areas).
Suggested fix for documentation
Not sure. Do we fix the docs so that it executes the code rather than have hard coded results?
Do we want to indicate whether we are returning numpy types or python types?