我有两个分别为2维和1维的numpy nd数组列表。我想使用作为我的数据框的2列的2个列表创建一个熊猫数据框。本人谨此陈辞:
Mfcc = np.arange(1,11,1)
Mfcc = np.reshape(Mfcc, (-1, 2))
Mel_spec = np.arange(1,10,2)
df = pd.DataFrame(list(zip(Mfcc, Mel_spec)),
columns =['mfcc', 'mel_spectogram']) ### mfcc is 2d and mel_spectogram is 1d
type(df.mfcc[1]) ### returns string, when it should return a 1d array
type(df.mel_spectogram[1]) ### returns string, when it should return float being the first element of the array
我如何才能做到这一点?我可能在哪里犯错误
此代码正在工作,请根据此代码修复Mfcc和Mel_规范
相关问题 更多 >
编程相关推荐