【发布时间】:2019-10-31 03:52:17
【问题描述】:
我是 python 的新手,我正在学习它。我已经编写了以下代码,但我无法对其进行任何功能。有人可以帮帮我吗?
import pandas as pd
import numpy as np
f = open('1.csv', 'r')
df = pd.read_csv(f, usecols=[0], sep="\t", index_col=False)
Primary_List = df.values.tolist()
x = 0
y = len(Primary_List)
for i in range(x, y):
x = i
MyMatrix = Primary_List[x:x + 10]
print(MyMatrix)
【问题讨论】:
-
你的意思是你想在你的代码中定义一个函数?
标签: pandas list csv numpy matrix