赞
踩
1.数据清洗
1.1缺失值处理
1.1.1 缺失值处理方法:删除记录、数据插补、不处理;
1.1.2 常用的插补方法:
1.1.3 拉格朗日插值法
对于平面上已知的n个点可以找到一个n-1次多项式
示例:
- from scipy.interpolate import lagrange
-
- if __name__ == '__main__':
- x = [1, 2, 3, 4, 7]
- y = [5, 7, 10, 3, 9]
- a = lagrange(x, y)
- print(type(a)) #a的类型
- print('==================================================================================')
- print(a) #打印a,a是一个关于x的4阶多项式
- print('==================================================================================')
- print(a.order) #a阶数
- print('==================================================================================')
- print(a(1)) #求x=1时,a的函
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。