промежуточное

This commit is contained in:
ElEgEv 2023-10-11 21:05:27 +04:00
parent 13a8b21080
commit ec32341418
3 changed files with 21 additions and 0 deletions

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Black">
<option name="sdkName" value="Python 3.11" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11" project-jdk-type="Python SDK" />
<component name="PyCharmProfessionalAdvertiser">
<option name="shown" value="true" />

View File

@ -0,0 +1,18 @@
import pandas
# создаём усовершенствованную таблицу
def addData(df: pandas.DataFrame):
# узнаём средние значения для всех столбцов
mean_store_sales = df['Store_Sales'].mean()
mean_daily_customer_count = df['Daily_Customer_Count'].mean()
mean_items_available = df['Items_Available'].mean()
mean_store_area = df['Store_Area'].mean()
additionForTable = int(len(df) / 10)
# добавили 10% значений
for i in range(additionForTable):
df.loc[len(df.index)] = [mean_store_area, mean_items_available, mean_daily_customer_count, mean_store_sales]
return df