python numpy多维数组是不是每一维长度必须相同
python numpy多维数组是否每一维长度必须相同?
问题情境,有三家门店A/B/C的日交易额,现在要分别求他们的均值,
A 12 20140101
B 13 20140101
C 12 20140101
A 13 20140102
B 12 20140102
C 13 20140102
A 12 20140103
A 13 20140104
A 12 20140105
A 13 20140106
A 12 20140107
A 13 20140108
我知道numpy中可以写下面的程序
narray=numpy.array(nlist)
sum1=narray.sum()
但我想编译一遍后就计算出ABC的均值
------解决方案--------------------
就按你顶楼原来显示的方式存储就行了,然后用filter之类提取相似项进行sum、count等操作
------解决方案--------------------
usecols : sequence, optional
Which columns to read, with 0 being the first. For example,
``usecols = (1,4,5)`` will extract the 2nd, 5th and 6th columns.
The default, None, results in all columns being read.
问题情境,有三家门店A/B/C的日交易额,现在要分别求他们的均值,
A 12 20140101
B 13 20140101
C 12 20140101
A 13 20140102
B 12 20140102
C 13 20140102
A 12 20140103
A 13 20140104
A 12 20140105
A 13 20140106
A 12 20140107
A 13 20140108
我知道numpy中可以写下面的程序
narray=numpy.array(nlist)
sum1=narray.sum()
但我想编译一遍后就计算出ABC的均值
------解决方案--------------------
就按你顶楼原来显示的方式存储就行了,然后用filter之类提取相似项进行sum、count等操作
------解决方案--------------------
usecols : sequence, optional
Which columns to read, with 0 being the first. For example,
``usecols = (1,4,5)`` will extract the 2nd, 5th and 6th columns.
The default, None, results in all columns being read.