New_Dir=Dir.copy() Null_List=[] for k in New_Dir: if(New_Dir[k]==0): Null_List.append(k) for i in range(len(Null_List)): New_Dir.pop(Null_List[i]) labels = [] share = [] for k in New_Dir: Labels. Append (k) share. Append (New_Dir [k]) PLT. The pie (share, labels = labels, autopct = '% % % 3.1 f, startangle = 180, shadow = True, colors=['#90b44b', '#0DF4FB','#DB25CB','#F96701','#1805FF']) plt.title(title) plt.savefig('Statistics.jpg') plt.close()Copy the code