python 判断矩阵中每行非零个数的方法: # -*- coding: utf-8 -*- # @Time : 2018/5/17 15:05 # @Author : Sizer # @Site : # @File : test.py # @Software: PyCharm import time import numpy as np # data = np.array([ # [5.0, 3.0, 4.0, 4.0, 0.0], # [3.0, 1.0, 2.0, 3.0, 3.0], #…