hello,123,nihao
8,9,10
io,he,no
import numpy
# dtype:默认读取数据类型,delimiter:分隔符
world_alcohol = numpy.genfromtxt("test1.txt", dtype=str, delimiter=",")
# 数据结构
print(type(world_alcohol))
# 数据内容
print(world_alcohol)
# 帮助文档
print(help(numpy.genfromtxt))
<class 'numpy.ndarray'>
[['hello' '123' 'nihao']
['8' '9' '10']
['io' 'he' 'no']]
...