![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
as12cs
这个作者很懒,什么都没留下…
展开
-
[Numpy] 数组和内存的浅复制和深复制(View vs Copy)
Numpy数组和内存 View vs Copy 或称 浅复制或深复制 一句话概括最重要的区别: 在对numpy切片(slicing)的时候,如果切片的表达式内含有带括号的非tuple对象,如数列,或者另一个numpy数列,或者tuple对象(但至少包含一个含有序列的对象或者一个numpy数列),则进行复制操作。其他情况下进行View操作,只是访问了原有numpy数列的内存。 (这个view是指浅复...原创 2019-02-17 15:47:02 · 414 阅读 · 0 评论 -
[Numpy] 数组广播的两个例题:找零问题,最近邻居问题
找零问题 25分分成10分,5分和1分怎么分呢?有多少种分法? Using broadcasting, compute the number of ways a quarter (i.e., 25 cents) can be split into pennies, nickels, and dimes. Hint: You can do this using loops as n=0 # star...原创 2019-02-18 06:05:13 · 263 阅读 · 0 评论 -
[Numpy] 对象线上填均值:numpy数组where的巧用
对象线上填均值:numpy数组where的巧用 原题目 大意为在对角线上填上行均值 Given the following two-dimensional array, set the diagonal element to the average of the columns in each respective row not counting the diagonal element in...原创 2019-02-18 15:50:07 · 413 阅读 · 0 评论