numpy array.A的内置函数A是什么? [英] What is the built-in function A of numpy array.A?

查看:144
本文介绍了numpy array.A的内置函数A是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我读了一行使我感到困惑的代码:

Recently I read a line of code that confused me:

pointsInCurrCluster = dataSet[nonzero(clusterAssment[:, 0].A == i)[0], :]  

作者没有为A定义函数,因此我认为.A是某种内置函数.有人知道这是什么吗?

The author did not define the function for A, so I assume that .A is some kind of built-in function. Does anyone know what it is?

推荐答案

好,所以我认为这是scipy矩阵的支持者,返回nparray:

Ok, so in this way I think its is proparty of scipy matrix returning nparray:

In [115]: mtx = sp.matrix([1,2,3])    
In [116]: mtx.A
Out[116]: array([[1, 2, 3]])

A getA .

这篇关于numpy array.A的内置函数A是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆