Yifan Luo

Results 7 issues of Yifan Luo

> 82. Compute a matrix rank (★★★) > hint: np.linalg.svd > > \# Author: Stefan van der Walt > > Z = np.random.uniform(0,1,(10,10)) > U, S, V = np.linalg.svd(Z) #...

> 70. Consider the vector [1, 2, 3, 4, 5], how to build a new vector with 3 consecutive zeros interleaved between each value? (★★★) > hint: array[::4] > >...

`Q.83`: The `np.bincount` only counts **non-negative ints** according to its docs, which is not very useful in the dirty dataset. It can be optimized with `np.unique(data, return_counts=True)`, which returns the...

1. 除了本地配置`Jupyter Notebook`之外,使用`Colab`和`Datalore`等在线软件会更方便一些。 2. 可以添加一些使用远程服务器上的`Jupyter Notebook`的方法。

`pd.Series.loc`: > "Access a group of rows and columns by label(s) or a boolean array." `pd.Series.iloc`: > "Purely integer-location based indexing for selection by position." “无视索引,只按照位置定位。” → “以(整数形式的)索引实现位置定位。” `iloc`中的`i`可以指`integer`,也可以指`index`。总之,在使用方法上通过`interger-based index`实现定位。...

Hi @rougier, Q.83 asks `How to find the most frequent value in an array?` And the current answer is: ``` python Z = np.random.randint(0,10,50) print(np.bincount(Z).argmax()) ``` The document says `np.bincount`...

Hi developer, The original prior probability `prior = Pmf(1, hypos)` in Ch.4 is initialised with 1: It's better to be initialised with `prior2 = Pmf(Fraction(1, len(hypos)), hypos)`, which is a...