我有以下问题:如何更改curve2
(列表)的格式。我想要类似curve
curve = [0.0556, 0.0563]
curve2 = [[0.0159, 0.0178]]
上下文:我想应用特定的代码,但是由于输入格式不同,我没有得到期望的结果
我的代码如下:
import pandas as pd
import numpy as np
curve = [0.0556, 0.0563]
curve2 = [[0.0159, 0.0178]]
df= pd.DataFrame()
def SUM (curve):
df['COl1'] = curve
return df
print(SUM(curve))
PD:curve2
是从数组(作为列表)中提取的一行:
[[ 0.01593353 0.01783041]
[ 0.00917833 0.00593893]
[ 0.00829569 0.02123637]
[-0.03057529 -0.04138836]
[ 0.05212978 0.03239212]]