1
我一直在用python進行數據分析的一個例子,這個例子是寶寶的名字。我生成在下面的格式的數據幀,繪製一個數據框,pandas python
1880 F [38] M [14]
1881 F [38] M [14]
1882 F [38] M [15]
1883 F [39] M [15]
1884 F [39] M [16]
我已經使用以下例程,它返回一個索引值生成此 年性。
def get_quantile_count(group, q=0.5):
group = group.sort_index(by='prop', ascending=False)
return group.prop.cumsum().searchsorted(q) + 1
當我試圖繪製這個數據框時,我得到一個error.Are這些指數不被認爲是數值嗎?
TypeError: Empty 'DataFrame': no numeric data to plot
如果創建圖和座標軸的對象,你應該直接暗算的軸(即'ax.plot(TRA .. 。)') –