1
我創建了這個數據:KeyError異常簡單的數據集regplot - AttributeError的: '海峽' 對象有沒有屬性 '結合'
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
data = np.array([['', 'Gross ', 'Target'],
[0, 728, 500],
[1, 701, 750],
[2, 590, 570],
[3, 548, 596]])
df = pd.DataFrame(data=data[1:, 1:], columns=data[0, 1:])
df
Gross Target
0 728 500
1 701 750
2 590 570
3 548 596
,並試圖繪製:
sns.regplot(x='Gross', y='Target', data=df)
結果:KeyError: 'Gross'
--- UPDATE ---
固定的空白,我後接收:
AttributeError: 'str' object has no attribute 'conjugate'
Hmm.I沒有注意到,thanks.But,現在它給了我:'AttributeError的: '海峽' 對象有沒有屬性「conjugate'' – George
看來你有老版本的熊貓。你的版本是什麼? – jezrael
我正在使用0.19.2 – George