-
Notifications
You must be signed in to change notification settings - Fork 10
Moment
Maurice HT Ling edited this page Aug 13, 2021
·
2 revisions
Purpose: To get the n-th moment of a data set.
Code:
>>> from scipy import stat
>>> X = [9.07, 8.97, 6.41, 3.03, 1.19, 2.67, 2.81, 9.2]
>>> result = stats.moment(X, moment=1)
>>> print("First moment = %.2f" % result)
First moment = 0.00
>>> result = stats.moment(X, moment=2)
>>> print("Second moment = %.2f" % result)
Second moment = 9.90
>>> result = stats.moment(X, moment=3)
>>> print("Third moment = %.2f" % result)
Third moment = 2.59
Copyright (c) 2008-2024, Maurice HT Ling
Refereed Publications and Technical Reports
Abstracts and Other Un-Refereed Works
Autobiographic Verses (Poems that I wrote) and My Sayings