-1
使用itertools我进口,其中的数据看起来像在python
25
34
45
23
34
23
24
import itertools
import pandas as pd
filename = 'myFile.csv'
myArray1 = pd.read_csv(filename, header=None)
myArray2 = pd.read_csv(filename, header=None)
for a, b in itertools.product(myArray1, myArray2):
print(a,b)
但只输出
0 0
当我运行一个CSV文件:
myArray1 = [2,3,4]
myArray2 = [4,5,6]
for a, b in itertools.product(myArray1, myArray2):
print(a,b)
输出就像
2 4
2 5
2 6
3 4
3 5
3 6
4 4
4 5
4 6
所以我想从这样的CSV数据输出
如果没有更多的CSV数据,这将很难诊断。 'itertools.product'之前'myArray1'和'myArray2'的输出是什么? –
对不起,但您已编辑您的问题与其他问题。你已经有效地改变了你的问题陈述。如果您有其他问题,请关闭此问题,接受答案,并打开一个新问题。我已经回滚了你的编辑,它会让读者感到困惑。请不要再这样做。 –