python_math_stat/practica/math/statistic/statistic_tests/test.py
2023-10-12 21:29:45 +03:00

45 lines
1.6 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# import pandas as pd
# import matplotlib.pyplot as plt
# import statsmodels.api as sm
# from statsmodels.formula.api import ols
# import seaborn as sns
# import numpy as np
# import pandas.tseries
# plt.style.use('fivethirtyeight')
# mydata = pd.read_csv('c:/Users/admin/Documents/prog/hello/practica/DataBase/diet.csv')
# print(mydata.head()) # просмотр данных
# print('The total number of rows in the dataset:', mydata.size) # размер файла (строк)
# print(mydata.gender.unique())
# print(mydata[mydata.gender == ' ']) # проверяем и удаляем значения которые отсутствуют в наборе
# # f, ax = plt.subplots( figsize =(11,9) )
# # sns.distplot( mydata)
# # plt.show()
# f, ax = plt.subplots( figsize =(11,9) )
# sns.distplot( mydata[mydata.gender == '1'].weight6weeks, ax = ax, label = 'Male')
# sns.distplot( mydata[mydata.gender == '0'].weight6weeks, ax = ax, label = 'Female')
# plt.title( 'Weight Distribution for Each Gender' )
# plt.legend()
# plt.show()
# import matplotlib.pyplot as plt
# import seaborn as sns
# # Генерируем случайные данные
# data = [23, 34, 45, 67, 23, 56, 78, 89, 43, 65, 34, 56, 76]
# # Построение ящика с усами
# plt.boxplot(data)
# plt.ylabel('Значения')
# plt.title('')
# plt.show()
import matplotlib.pyplot as plt
plt.hist(data['Цена'], bins=20, color='blue', alpha=0.7)
plt.xlabel('Цена')
plt.ylabel('Частота')
plt.title('Распределение цен на продукты')
plt.show()