我有一个名为store_x_axis.txt
的文件,其中包含
0.02153753289089977,0.01666949746870028,0.012109153483800483
0.01812035460886907,0.013230902143324563,0.008647475872060717
0.014703176326838374,0.009792306817948848,0.005185798260320951
0.011285998044807677,0.006353711492574021,0.0020684929408965047
0.00786881976277698,0.002915116167198306,0.0017375569631585819
0.004451641480746282,0.0007780382940847375,0.005199234574898348
0.001100981972369297,0.003962074483552236,0.008660912186638114
0.0023827150833160005,0.007400669808927951,0.01212258979837788
0.00579989336534581,0.010839265134302778,0.015584267410117647
我想在每列中获得最小值:0.001100981972369297,0.007400669808927951
和0.008647475872060717
。
我该怎么做?
答案 0 :(得分:0)
通常,常见任务通常通过库自动/优化。以下代码使用numpy
库来处理您的任务:
import numpy as np
arr = np.genfromtxt('file.txt', delimiter=',')
arr_colmin = arr.min(axis=0)