"Numpy"의 두 판 사이의 차이
ph
7번째 줄: | 7번째 줄: | ||
numpy.loadtxt(fname, dtype=<type 'float'>, comments='#', delimiter=None, converters=None, skiprows=0, usecols=None, unpack=False, ndmin=0) | numpy.loadtxt(fname, dtype=<type 'float'>, comments='#', delimiter=None, converters=None, skiprows=0, usecols=None, unpack=False, ndmin=0) | ||
https://docs.scipy.org/doc/numpy/reference/generated/numpy.loadtxt.html | https://docs.scipy.org/doc/numpy/reference/generated/numpy.loadtxt.html | ||
+ | |||
+ | =={{c|histogram}}== | ||
+ | numpy.histogram(a, bins=10, range=None, normed=False, weights=None, density=None) | ||
+ | |||
+ | >>> import matplotlib.pyplot as plt | ||
+ | >>> rng = np.random.RandomState(10) # deterministic random data | ||
+ | >>> a = np.hstack((rng.normal(size=1000), | ||
+ | ... rng.normal(loc=5, scale=2, size=1000))) | ||
+ | >>> plt.hist(a, bins='auto') # plt.hist passes it's arguments to np.histogram | ||
+ | >>> plt.title("Histogram with 'auto' bins") | ||
+ | >>> plt.show() | ||
+ | https://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram.html |
2017년 4월 20일 (목) 14:13 판
bincount
Count number of occurrences of each value in array of non-negative ints.
numpy.bincount(x, weights=None, minlength=None)
https://docs.scipy.org/doc/numpy/reference/generated/numpy.bincount.html
loadtxt
numpy.loadtxt(fname, dtype=<type 'float'>, comments='#', delimiter=None, converters=None, skiprows=0, usecols=None, unpack=False, ndmin=0)
https://docs.scipy.org/doc/numpy/reference/generated/numpy.loadtxt.html
histogram
numpy.histogram(a, bins=10, range=None, normed=False, weights=None, density=None)
>>> import matplotlib.pyplot as plt >>> rng = np.random.RandomState(10) # deterministic random data >>> a = np.hstack((rng.normal(size=1000), ... rng.normal(loc=5, scale=2, size=1000))) >>> plt.hist(a, bins='auto') # plt.hist passes it's arguments to np.histogram >>> plt.title("Histogram with 'auto' bins") >>> plt.show()
https://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram.html