方法
ma.masked_array.
tolist
以层次结构python列表的形式返回屏蔽数组的数据部分。
数据项将转换为最接近的兼容python类型。屏蔽值转换为 fill_value .如果 fill_value 如果为“无”,则输出列表中的相应条目将 None .
None
用于无效项的值。默认值为无。
屏蔽数组的python列表表示形式。
实例
>>> x = np.ma.array([[1,2,3], [4,5,6], [7,8,9]], mask=[0] + [1,0]*4) >>> x.tolist() [[1, None, 3], [None, 5, None], [7, None, 9]] >>> x.tolist(-999) [[1, -999, 3], [-999, 5, -999], [7, -999, 9]]