《Python数据分析基础教程:Numpy学习指南》 常用模块与方法简要记录

时间:2022-12-06 21:27:00

第三章 numpy的常用函数

1.savetxt
2.loadtxt (converters): datetime.datetime.strptime [p46]
3.average
4.mean
5.max
6.min
7.ptp
8.median
9.msort/sort
10.var
11.diff
12.std
13.where
14:take
15:argmax ----- *
16:argmin ----- *
17.ravel
18.split\hsplit\vsplit
19.apply_along_axis
20.maximum ----- *
21.minimum ----- *
22.convolve
23.eye
24.zeros
25.ones
26.linspace
27.exp
28.fill
29.linalg.lstsq
30.dot
31.ones_like
32.intersect1d
33.vstack\hstack\dstack\column_stack\row_stack
34.concatenate


ndarray常用函数和属性

ndarray的常用函数
1.mean
2.ravel
3.sum
4..clip
5.compress
6.prod
7.cumprod
8.tolist
9.astype
10.resh

ndarray的常用属性
1.ndim
2.size
3.itemsize
4.shape
5.dtype
6.nbytes
7.T
8.real
9.imag
10.flat


第四章 numpy的便捷函数

1.diagonal
2.trace
3.cov
4.corrcoef
5.std ddof=1
6.polyfit
7.polyval
8.roots
9.polyder
10.sign
11.piecewise
12.vectorize
13.hanning
14.polysub
15.isreal
16.select
17.trim_zeros


第五章 矩阵和通用函数

1.mat
① 专用字符串: " "行间隔, ";"列间隔
② 数组
2.bmat
3.frompyfunc
4.zeros_like
5.add.reduce
6.add.accumulate
7.add.reduceat
8.add.outer
9.add\subtract\multiply\divide\true_divide\floor_division
10."/" "//"
11.mod\%\remainder\fmod
12.matrix


第六章 深入Numpy模块

1.np.dual
2.np.linalg.inv
3.np.mat 注意,矩阵乘法和数组乘法不相同,与数组dot方法相同
4.np.linalg.solve
5.np.linalg.eigvals
6.np.linalg.eig
7.np.linalg.svd
8.np.linalg.pinv
9.np.linalg.det
10.np.fft.fft
11.np.fft.ifft
12.np.all
13.np.linalg.fftshift
14.np.linalg.ifftshift
15.np.random.binomial
16.np.random.hypergeometirc
17.np.random.beta
chisquare
exponential
f
gamma
gumbel
laplace
lognormal
logistic
multivariate_nomal
noncentral_chisquare
noncentral_f
normal


第七章 Numpy专用函数

1.np.sort
lexsort
argsort
ndarray.sort
msort
sort_complex
2.np.argmax
3.np.nanargmax
4.np.argmin
5.np.nanargmin
6.np.argwhere
7.np.searchsorted
8.np.extract
9.np.insert
10.np.nonzero
11.np.bartlett
12.np.blackman
13.np.hamming
14.np.hanning
15.np.kaiser
12.np.i0
13.np.sinc


第八章 质量控制

1.np.testing.assert_almost_equal
2.np.testing.assert_approx_equal
3.np.testing.assert_array_almost_equal
4.np.testing.assert_array_equal
5.np.testing.assert_array_less
6.np.testing.assert_equal
7.np.testing.assert_raises
8.np.testing.assert_warns
9.np.testing.assert_string_equal
10.np.testing.assert_allclose
11.np.testing.assert_alloclose
12.np.testing.assert_array_almost_equal_nulp
13.np.testing.assert_array_max_ulp
14.import unittest
from numpy.testing.decorators import setastest
from numpy.testing.decorators import skipif
from numpy.testing.decorators import knownfailureif
from numpy.testing import decorate_methods
15.numpy.testing.decorators.deprecated
16.numpy.testing.decorators.knownfailureif
17.numpy.testing.decorators.setastest
18.numpy.testing.decorators.skipif
19.numpy.testing.decorators.slow
20.from numpy.testing import rundocs


第九章 使用Matplotlib

1.import matplotlib.pyplot as plt
2.np.poly1d
3.plt.plot
4.plt.xlabel
5.plt.ylabel
6.plt.show
7.np.poly1d.deriv
8.plt.subplot
9.plt.title
10.plt.figure
11.plt.figure.add_subplot
12.axis.set_major_locator
13.axis.set_minor_locator
14.axis.set_major_fomatter
15.figure.autofmt_xdate
16.from datetime import date
17.date.today
18.plt.hist
19.plt.semilogx
20.plt.semilogy
21.plt.loglog
22.plt.scatter
23.figure.set_title
24.plt.grid
25.plt.fill_between
26.plt.legend
27.plt.annotate
28.np.meshgrid
29.plt.plot_surface
30.plt.contour/plt.contourf
31.np.random.rand
32. import matplotlib.animation as animation
33. animation.FuncAnimation
34. from mpl_toolkits.mplot3d import Axes3D


第十章 SciPy

0.from scipy import stats
1. stats.norm.rvs
2.stats.norm.fit
3.stats.kurtosistest
4.stats.skewtest
5.stats.normaltest
6.stats.scoreatpercentile
7.stats.percentileofscore
8.stats.ttest_ind
9.stats.ks_2samp
10.from scikits.statsmodels.stattools import jarque_bera
11.from scipy import signal
signal.detrend
12.from scipy import fftpack
fftpack.fftshift
fftpack.rfft
ffpack.iffshift
ffpack.irfft
13.from scipy import optimize
optimize.leastsq
14.from scipy import integrate
integrate.quad
15.from scipy imprt interpolate
interpolate.interp1d
interpolate.interp2d
16.from scipy import ndimage
ndimage.median_filter
ndimage.rotate
ndimage.prewitt
17.from scipy import misc
image = misc.lena().astype(np.float)
18.plt.imshow(image, cmap=plt.cm.gray)
19. from scipy.io import wavfile
wavfile.read
wavfile.write
20.np.tile
21.import urllib2
urllib2.urlopen