numpy中reshap函数参数为-1的情况分析
最近学机器学习的时候,看到这样一段代码:x.reshape(-1,1),一直搞不懂参数-1是什么意思。最后就去看了看官方文档:
我们主要看一下红框框里面的内容:
The new shape should be compatible with the original shape. If an integer, then the result will be a 1-D array of that length. One shape dimension can be -1. In this case,
原创
2020-10-27 11:16:56 ·
801 阅读 ·
0 评论