私はデータフレームDFを持っている -のPython 3.xの - 水平バープロット
Source Amount
1 University of Minnesota 119367000
2 Minnesota State Colleges and Universities 159812000
3 Education 7491000
4 Minnesota State Academies 11354000
5 Perpich Center for Arts Education 2000000
6 Natural Resources 63480000
7 Pollution Control Agency 2625000
8 Board of Water and Soil Resources 8000000
9 Agriculture 203000
10 Zoological Garden 12000000
11 Administration 127000000
12 Minnesota Amateur Sports Commission 7973000
13 Military Affairs 3244000
14 Public Safety 4030000
15 Transportation 57263000
16 Metropolitan Council 45968000
17 Human Services 86387000
18 Veterans Affairs 2800000
19 Corrections 11881000
20 Employment and Economic Development 92130000
21 Public Facilities Authority 45993000
22 Housing Finance Agency 20000000
23 Minnesota Historical Society 12002000
24 Bond Sale Expenses 900000
25 Cancellations -10849000
26 TOTAL 893054000
27 Bond Proceeds Fund (General Fund Debt Servic... 814745000
28 Bond Proceeds Fund (User Financed Debt Servi... 39104000
29 State Transportation Fund 36613000
30 Maximum Effort School Loan Fund 5491000
31 Trunk Highway Fund 7950000
32 Bond Proceeds Cancellations -10849000
DF- 私はこのデータをプロットする水平barplotを作成したいです。
import matplotlib.pyplot as plt
plt.barh(expense_df['Amount'],expense['Source'])
plt.show()
しかし、上記のコード部分は与え、エラー - TypeError: cannot convert the series to <class 'int'>
どのように私は、水平バープロットを作成することができますか?
私は、Excelで予想プロットにプロットしている - 私はPythonでこれを再作成するにはどうすればよい
を?
あなたが投稿データ、それは、偽のパブリックまたは機密のですか? – gboffi
公開データ。 source- https://www.revisor.mn.gov/laws/?year=2014&type=0&doctype=Chapter&id=294 –