# 菜鸟 机 学 的 逆袭 之 路 # day7

The random.choice () function in
#numpy numpy.random.choice (a, size = None, replace = True, p = None)
a: if it is a one-dimensional array, it means that it is randomly sampled from this one-dimensional array; if It is int type, which means random sampling in the sequence from 0 to a-1.
size: The number of sampling results, the default is 1. It can be an integer indicating the number of samples to be sampled; it can also be a tuple, such as (m, n, k), the number of samples to be sampled is m * n * k, and the size is ( m, n, k).
replace: boolean type, should the sampled samples be replaced? I do n’t quite understand this place. I tested and found that when replace is specified as True, the sampled elements will be repeated; when replace is specified as False, the sampling will not be repeated.
p: a one-dimensional array that specifies the sampling probability of each element in a. If it is None, the probability of sampling each element in a is the same.
– Reprinted from the original link: https://blog.csdn.net/qq_25436597/article/details/79815800

#Call the subplot () function to create a subplot, and then the program can draw on the subplot. The nrows parameter of the subplot (nrows, ncols, index, ** kwargs) function specifies how many rows the data graph area is divided into; the ncols parameter specifies how many columns the data graph area is divided into; the index parameter specifies how many areas to get. —Reprinted
from the original link:
https://blog.csdn.net/fei347795790/article/details/94330592
Added: Personally think that the sharex and sharey parameters here should refer to the blank distance between the two sub-pictures

Published 31 original articles · praised 0 · visits 696

Guess you like

Origin blog.csdn.net/ballzy/article/details/104445595