Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- import numpy as np
- import matplotlib.pyplot as plt
- import seaborn as sns
- import plotly.express as px
- wb = load_workbook('/content/drive/My Drive/Colab Notebooks/table_to_proga.xlsx')
- sheet = wb['institutions_csv']
- fifthColumn = list()
- for i in range(2,343): #range от 2 до 343 потому что мы заполняем таблицу по i, row и col должны быть больше 0. Берем со 2 индекса, потому что в 1 строке хранится название каждого столбца
- fifthColumn.append(sheet.cell(row=i, column=5).value)
- d = dict.fromkeys(fifthColumn_set,0)
- for item in fifthColumn:
- d[item] +=1
- #print (d)
- #print(fifthColumn_set)
- arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 34, 35, 38, 40, 41]
- arrVal = [8,7,11,13,10,6,10,12,23,1,13,23,20,38,2,10,12,16,1,15,9,19,34,10,3,7,2,2]
- fig, ax = plt.subplots()
- explode = (0,0,0,0,0,0,0,0,0,0,0,0,0,0.2,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
- plt.figure(figsize=(20,10), dpi=500)
- ax.pie(arrVal, labels = arr, explode=explode)
- ax.axis("equal")
- print('Диаграмма, показывающая соотношение значений в графе "Stratification cell"')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement