промежуточное
This commit is contained in:
parent
13a8b21080
commit
ec32341418
@ -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" />
|
||||
|
18
LabWork01/LabWork3/AddData.py
Normal file
18
LabWork01/LabWork3/AddData.py
Normal 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
|
Loading…
Reference in New Issue
Block a user