The import XLRD
The date=XLRD. Open_workbook (' data. XLSX)
Table.=the date sheets () [0]
Print (table. Nrows)
Print (table. Ncols)
Names=[]
The sales=[]
For I in range (1, table. Nrows) :
Name=table. Row_values (I) [0]
Names. Append (name)
Sale=table. Row_values (I) [2]
Sales. Append (sale)
Print (names)
Print (sales)
The bar=bar ()
Bar. Add_xaxis (names)
Bar. Add_yaxis (' business details table 'sales)
Bar. Render (' sales icon. HTML)
Results: E: \ python \ pythonw exe C:/Users/Administrator/Desktop/data. Py
Traceback (the most recent call last) :
The File "C:/Users/Administrator/Desktop/data. Py", line 4, the in & lt; module>
Bar ()
AttributeError: 'Bar' object has no attribute 'add_xaxis'
Pray god to help have a look at what's the problem
CodePudding user response:
Pyechart v0.5. Incompatibility between X and v1, this is the old version pyechart code, you put the new pyechart, copy to codeCodePudding user response:
Online tutorial on the copy, I remember when installing pyecharts0.5.11 if it shows failed...CodePudding user response: