Traceback (most recent call last): File "C:/pythonnnn/pandas/midterm list.py", line 23, in <module> b.plot(x='ylevel', y='average') AttributeError: 'dict' object has no attribute 'plot'
import pandas as pd import matplotlib.pyplot as plt n=int(input("How many times: ")) name=[] section=[] ylevel=[] average=[] for i in range(n): sn = input("Name: ") sec=input("Section: ") yl=input("Level: ") avg=input("Average: ") name.append(sn) section.append(sec) ylevel.append(yl) average.append(avg) b={'Name': name,'Sec':section,'Level':ylevel,'Average':average} c=pd.DataFrame(b) print(c) b.plot(x='ylevel', y='average') print(b)
matplotlib
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)