题解 | #程序员工资的运算#
程序员工资的运算
https://www.nowcoder.com/practice/a38884490936440bb39d0041a4200ebb
import sys ''' for line in sys.stdin: a = line.split() print(int(a[0]) + int(a[1])) ''' ''' import numpy as np dt = np.genfromtxt('Salary.csv',delimiter=',',dtype=float) print(np.median(dt,axis=0)) print(np.mean(dt,axis=1)) ''' import numpy as np df = np.loadtxt('Salary.csv',delimiter=',') # print(type(df[0][0])) data1=[] data2=[] for i in range(df.shape[1]): temp=np.median(df[:,i]) data1=np.append(data1,temp) print(data1) for i in range(df.shape[0]): temp=np.median(df[i,:]) data2=np.append(data2,temp) print(data2)
这个是用比较基础的函数的