题解 | #牛客昵称信息#
牛客昵称信息
https://www.nowcoder.com/practice/b262a694852f4f0bba8086d646deeeda
import numpy as np Nowcoder = np.genfromtxt('Nowcoder.csv',delimiter=',',dtype=str) # # 方式一 # ls=[] # for i in range(len(Nowcoder)): # msg = Nowcoder[i,0] + Nowcoder[i,1] # ls.append(msg) # result = np.array(ls) # print(result) # # 方式二 # result = np.array([Nowcoder[i,0]+Nowcoder[i,1] for i in range(len(Nowcoder))]) # print(result) # 方式三 Nowcoder_N = Nowcoder.T # 转置操作 result = np.char.add(Nowcoder_N[0],Nowcoder_N[1]) print(result)