题解 | #牛客昵称信息#
牛客昵称信息
https://www.nowcoder.com/practice/b262a694852f4f0bba8086d646deeeda
import numpy as np
df= np.loadtxt('Nowcoder.csv',delimiter=',',dtype=str)
# print(df)
# a=df[...,0]
# b=df[...,1]
# print(a) #执行结果是列表['NiuNiu' 'NiuMei' 'NiuKele' 'NiuNeng' 'Tom' 'NiuDong' 'Jerry' 'Jam']
# print(b)
# print(a+b) #执行错误:numpy.core._exceptions.UFuncTypeError: ufunc 'add' did not contain a loop with signature matching types (dtype(' None
df1= np.array([df[i,0]+df[i,1] for i in range(df.shape[0])])
print(df1)