题解 | #牛客昵称信息#

牛客昵称信息

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)

全部评论

相关推荐

07-02 13:50
闽江学院 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务