learning-notes
learning-notes copied to clipboard
My learning notes.
例如,有一个二维数组 `X` 和一个列向量 `y`,它们的值如下: ```python >>> print(X) [[0 1] [2 3] [4 5]] >>> print(y) [[0] [1] [2]] ``` `X` 和 `y` 的行都是对应的,每一行表示一条样本数据。现在希望从中随机抽取两条数据,抽取出来的数据和原来的对应关系一致。
例如下面的代码: ```latex \begin{minted}[mathescape, gobble=2, fontsize=\scriptsize, framesep=2mm]{c++} int f(char str[], int index, int state) { if (strlen(str) 0) { // 的确存在匹配的右括号,将其中匹配的左括号置为' ' str[index] = ' '; return f(str, girlIndex+1, state); //...
参考: https://docs.scipy.org/doc/numpy/reference/generated/numpy.r_.html#numpy.r_ https://docs.scipy.org/doc/numpy/reference/generated/numpy.c_.html#numpy.c_
例如有下面的 3 行 4 列的矩阵 `a`: ```python >>> import numpy as np >>> a = np.arange(12).reshape(3, 4) >>> print(a) [[ 0 1 2 3] [ 4 5 6 7] [...
例如下面的代码,属于 `test` 模块,其中定义了 `fun1()` 和 `fun2()` 两个函数,`fun1()` 中用到了 `fun2()`: ```python def fun2(): print("fun2") def fun1(): print("fun1") fun2() ``` 现在在 Python 解释器中执行 `from test import fun1`,之后可以成功调用 `fun1()` 吗?可以成功调用 `fun2()` 吗?