从屏蔽数组中提取数据时,我没想到会有以下行为。
我有以下MaskedArray:
Application.ScreenUpdating = True
Dim iRow As Integer
iRow = ???
'Select row
Rows(iRow - 1).EntireRow.Copy
'Paste it into the new row
Rows(iRow).PasteSpecial
Rows(iRow).SpecialCells(xlConstants).ClearContents
Application.CutCopyMode = False
我期待以下结果:
import numpy as np
data = [[7374.0,10244.0,7386.0,-0.16211003970504823],[7433.0,12013.0,7569.0,-0.2269431110203248],[6788.0,9744.0,6963.0,-0.1664571736397917],[6895.0,14311.0,7358.0,-0.3208731367391204],[8143.0,10208.0,7777.0,-0.13516819571865443]]
mask=[[False,False,False],[False,False]]
z = np.ma.MaskedArray(data,mask=mask)
np.ma.getdata(z) # extract the data only
但是我得到了
array([[7374.0,-0.13516819571865443]])