Compare commits
No commits in common. "main" and "my-changes" have entirely different histories.
main
...
my-changes
2
.idea/1xz.iml
generated
2
.idea/1xz.iml
generated
@ -4,7 +4,7 @@
|
|||||||
<content url="file://$MODULE_DIR$">
|
<content url="file://$MODULE_DIR$">
|
||||||
<excludeFolder url="file://$MODULE_DIR$/.venv" />
|
<excludeFolder url="file://$MODULE_DIR$/.venv" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="jdk" jdkName="Python 3.13 (1xz)" jdkType="Python SDK" />
|
<orderEntry type="jdk" jdkName="Python 3.13 (2xz)" jdkType="Python SDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
||||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@ -3,5 +3,5 @@
|
|||||||
<component name="Black">
|
<component name="Black">
|
||||||
<option name="sdkName" value="Python 3.13 (PythonProject)" />
|
<option name="sdkName" value="Python 3.13 (PythonProject)" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.13 (1xz)" project-jdk-type="Python SDK" />
|
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.13 (2xz)" project-jdk-type="Python SDK" />
|
||||||
</project>
|
</project>
|
||||||
0
.ipynb_checkpoints/README-checkpoint.md
Normal file
0
.ipynb_checkpoints/README-checkpoint.md
Normal file
6
.ipynb_checkpoints/drygoe-checkpoint.ipynb
Normal file
6
.ipynb_checkpoints/drygoe-checkpoint.ipynb
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"cells": [],
|
||||||
|
"metadata": {},
|
||||||
|
"nbformat": 4,
|
||||||
|
"nbformat_minor": 5
|
||||||
|
}
|
||||||
16
.ipynb_checkpoints/main-checkpoint.py
Normal file
16
.ipynb_checkpoints/main-checkpoint.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# This is a sample Python script.
|
||||||
|
|
||||||
|
# Press Shift+F10 to execute it or replace it with your code.
|
||||||
|
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
|
||||||
|
|
||||||
|
|
||||||
|
def print_hi(name):
|
||||||
|
# Use a breakpoint in the code line below to debug your script.
|
||||||
|
print(f'Hi, {name}') # Press Ctrl+F8 to toggle the breakpoint.
|
||||||
|
|
||||||
|
|
||||||
|
# Press the green button in the gutter to run the script.
|
||||||
|
if __name__ == '__main__':
|
||||||
|
print_hi('PyCharm')
|
||||||
|
|
||||||
|
# See PyCharm help at https://www.jetbrains.com/help/pycharm/
|
||||||
6
.ipynb_checkpoints/matplotlib-checkpoint.ipynb
Normal file
6
.ipynb_checkpoints/matplotlib-checkpoint.ipynb
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"cells": [],
|
||||||
|
"metadata": {},
|
||||||
|
"nbformat": 4,
|
||||||
|
"nbformat_minor": 5
|
||||||
|
}
|
||||||
6
.ipynb_checkpoints/numpy-checkpoint.ipynb
Normal file
6
.ipynb_checkpoints/numpy-checkpoint.ipynb
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"cells": [],
|
||||||
|
"metadata": {},
|
||||||
|
"nbformat": 4,
|
||||||
|
"nbformat_minor": 5
|
||||||
|
}
|
||||||
6
.ipynb_checkpoints/pandas-checkpoint.ipynb
Normal file
6
.ipynb_checkpoints/pandas-checkpoint.ipynb
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"cells": [],
|
||||||
|
"metadata": {},
|
||||||
|
"nbformat": 4,
|
||||||
|
"nbformat_minor": 5
|
||||||
|
}
|
||||||
6
.ipynb_checkpoints/seaborn-checkpoint.ipynb
Normal file
6
.ipynb_checkpoints/seaborn-checkpoint.ipynb
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"cells": [],
|
||||||
|
"metadata": {},
|
||||||
|
"nbformat": 4,
|
||||||
|
"nbformat_minor": 5
|
||||||
|
}
|
||||||
6
.ipynb_checkpoints/tqdm-checkpoint.ipynb
Normal file
6
.ipynb_checkpoints/tqdm-checkpoint.ipynb
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"cells": [],
|
||||||
|
"metadata": {},
|
||||||
|
"nbformat": 4,
|
||||||
|
"nbformat_minor": 5
|
||||||
|
}
|
||||||
21
clothing_sizes.csv
Normal file
21
clothing_sizes.csv
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
id,height,weight,age,chest_size,waist_size,hip_size,size,brand,category,price,rating,purchase_count
|
||||||
|
1,165,55,25,85,68,92,S,Zara,Dress,45.99,4.5,120
|
||||||
|
2,170,65,30,95,78,100,M,H&M,Jeans,59.99,4.2,85
|
||||||
|
3,175,75,28,100,85,105,L,Adidas,T-shirt,29.99,4.7,200
|
||||||
|
4,160,50,22,80,65,88,XS,Mango,Blouse,39.99,4.3,95
|
||||||
|
5,180,85,35,110,92,110,XL,Nike,Jacket,89.99,4.6,150
|
||||||
|
6,168,60,27,88,72,94,S,Uniqlo,Sweater,49.99,4.4,110
|
||||||
|
7,172,70,32,98,82,102,M,Zara,Pants,54.99,4.1,75
|
||||||
|
8,178,80,29,105,88,108,L,H&M,Hoodie,44.99,4.5,130
|
||||||
|
9,162,52,24,82,66,90,XS,Mango,Dress,64.99,4.8,90
|
||||||
|
10,175,72,31,102,86,106,L,Adidas,Shorts,34.99,4.3,105
|
||||||
|
11,167,58,26,87,70,93,S,Uniqlo,T-shirt,24.99,4.6,180
|
||||||
|
12,173,68,33,96,80,101,M,Nike,Leggings,39.99,4.4,95
|
||||||
|
13,182,90,36,112,95,112,XXL,Puma,Jacket,99.99,4.2,65
|
||||||
|
14,158,48,21,78,63,86,XXS,Zara,Blouse,42.99,4.7,88
|
||||||
|
15,169,62,29,90,74,96,S,H&M,Jeans,55.99,4.3,115
|
||||||
|
16,176,76,34,103,87,107,L,Mango,Coat,129.99,4.5,70
|
||||||
|
17,164,54,23,84,67,91,S,Adidas,Sneakers,79.99,4.8,220
|
||||||
|
18,171,66,30,94,77,99,M,Uniqlo,Polo,34.99,4.4,100
|
||||||
|
19,177,78,28,104,89,109,L,Nike,Tracksuit,89.99,4.6,85
|
||||||
|
20,163,53,25,83,68,90,XS,Zara,Skirt,37.99,4.2,92
|
||||||
|
344
drygoe.ipynb
Normal file
344
drygoe.ipynb
Normal file
File diff suppressed because one or more lines are too long
124
matplotlib.ipynb
Normal file
124
matplotlib.ipynb
Normal file
File diff suppressed because one or more lines are too long
109
numpy.ipynb
Normal file
109
numpy.ipynb
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
{
|
||||||
|
"cells": [
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 2,
|
||||||
|
"id": "3af2cc9d-8792-4968-972a-cdfed0d85dce",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"Моя матрица 2x2:\n",
|
||||||
|
"[[ 5 7]\n",
|
||||||
|
" [ 9 10]]\n",
|
||||||
|
"\n",
|
||||||
|
"Тестирую linspace:\n",
|
||||||
|
"Массив от 0 до 10 с 5 элементами:\n",
|
||||||
|
"[ 0. 2.5 5. 7.5 10. ]\n",
|
||||||
|
"\n",
|
||||||
|
"Случайные числа из randn:\n",
|
||||||
|
"[ 0.16121834 0.8534192 -1.17185391]\n",
|
||||||
|
"\n",
|
||||||
|
"Умножаю матрицу на саму себя через dot:\n",
|
||||||
|
"Результат:\n",
|
||||||
|
"[[ 88 105]\n",
|
||||||
|
" [135 163]]\n",
|
||||||
|
"\n",
|
||||||
|
"Сумма всех элементов матрицы:\n",
|
||||||
|
"31\n",
|
||||||
|
"Среднее арифметическое:\n",
|
||||||
|
"7.75\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"text/plain": [
|
||||||
|
"array([[ 5, 7],\n",
|
||||||
|
" [ 9, 10]])"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"execution_count": 2,
|
||||||
|
"metadata": {},
|
||||||
|
"output_type": "execute_result"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"import numpy as np\n",
|
||||||
|
"matrix = np.array([[5, 7], [9, 10]])\n",
|
||||||
|
"\n",
|
||||||
|
"print(\"Моя матрица 2x2:\")\n",
|
||||||
|
"print(matrix)\n",
|
||||||
|
"\n",
|
||||||
|
"print(\"\\nТестирую linspace:\")\n",
|
||||||
|
"arr = np.linspace(0, 10, 5)\n",
|
||||||
|
"print(\"Массив от 0 до 10 с 5 элементами:\")\n",
|
||||||
|
"print(arr)\n",
|
||||||
|
"\n",
|
||||||
|
"print(\"\\nСлучайные числа из randn:\")\n",
|
||||||
|
"random_arr = np.random.randn(3)\n",
|
||||||
|
"print(random_arr)\n",
|
||||||
|
"\n",
|
||||||
|
"print(\"\\nУмножаю матрицу на саму себя через dot:\")\n",
|
||||||
|
"result = np.dot(matrix, matrix)\n",
|
||||||
|
"print(\"Результат:\")\n",
|
||||||
|
"print(result)\n",
|
||||||
|
"\n",
|
||||||
|
"print(\"\\nСумма всех элементов матрицы:\")\n",
|
||||||
|
"summa = np.sum(matrix)\n",
|
||||||
|
"print(summa)\n",
|
||||||
|
"\n",
|
||||||
|
"print(\"Среднее арифметическое:\")\n",
|
||||||
|
"srednee = np.mean(matrix)\n",
|
||||||
|
"print(srednee)\n",
|
||||||
|
"\n",
|
||||||
|
"matrix"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "2bbf5089-c335-4e5a-8c8f-5b7858176c6d",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"kernelspec": {
|
||||||
|
"display_name": "Python 3 (ipykernel)",
|
||||||
|
"language": "python",
|
||||||
|
"name": "python3"
|
||||||
|
},
|
||||||
|
"language_info": {
|
||||||
|
"codemirror_mode": {
|
||||||
|
"name": "ipython",
|
||||||
|
"version": 3
|
||||||
|
},
|
||||||
|
"file_extension": ".py",
|
||||||
|
"mimetype": "text/x-python",
|
||||||
|
"name": "python",
|
||||||
|
"nbconvert_exporter": "python",
|
||||||
|
"pygments_lexer": "ipython3",
|
||||||
|
"version": "3.13.5"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nbformat": 4,
|
||||||
|
"nbformat_minor": 5
|
||||||
|
}
|
||||||
200
pandas.ipynb
Normal file
200
pandas.ipynb
Normal file
@ -0,0 +1,200 @@
|
|||||||
|
{
|
||||||
|
"cells": [
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 13,
|
||||||
|
"id": "e49a4fbc-f85f-47c0-b3a0-4af25468faa3",
|
||||||
|
"metadata": {
|
||||||
|
"scrolled": true
|
||||||
|
},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"Основная таблица с бонусами:\n",
|
||||||
|
" Имя Возраст Баллы Результат с бонусом Категория\n",
|
||||||
|
"0 Анна 21 89 102.35 Младше\n",
|
||||||
|
"1 Борис 22 76 87.40 Младше\n",
|
||||||
|
"2 Виктор 23 95 109.25 Старше\n",
|
||||||
|
"3 Галина 24 82 94.30 Старше\n",
|
||||||
|
"4 Дмитрий 21 91 104.65 Младше\n",
|
||||||
|
"\n",
|
||||||
|
"Статистика по группам:\n",
|
||||||
|
" Баллы Имя\n",
|
||||||
|
" mean max min count\n",
|
||||||
|
"Категория \n",
|
||||||
|
"Младше 85.33 91 76 3\n",
|
||||||
|
"Старше 88.50 95 82 2\n",
|
||||||
|
"\n",
|
||||||
|
"Отфильтрованные студенты:\n",
|
||||||
|
" Имя Возраст Баллы Результат с бонусом Категория\n",
|
||||||
|
"2 Виктор 23 95 109.25 Старше\n",
|
||||||
|
"4 Дмитрий 21 91 104.65 Младше\n",
|
||||||
|
"0 Анна 21 89 102.35 Младше\n",
|
||||||
|
"3 Галина 24 82 94.30 Старше\n",
|
||||||
|
"1 Борис 22 76 87.40 Младше\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"text/html": [
|
||||||
|
"<div>\n",
|
||||||
|
"<style scoped>\n",
|
||||||
|
" .dataframe tbody tr th:only-of-type {\n",
|
||||||
|
" vertical-align: middle;\n",
|
||||||
|
" }\n",
|
||||||
|
"\n",
|
||||||
|
" .dataframe tbody tr th {\n",
|
||||||
|
" vertical-align: top;\n",
|
||||||
|
" }\n",
|
||||||
|
"\n",
|
||||||
|
" .dataframe thead th {\n",
|
||||||
|
" text-align: right;\n",
|
||||||
|
" }\n",
|
||||||
|
"</style>\n",
|
||||||
|
"<table border=\"1\" class=\"dataframe\">\n",
|
||||||
|
" <thead>\n",
|
||||||
|
" <tr style=\"text-align: right;\">\n",
|
||||||
|
" <th></th>\n",
|
||||||
|
" <th>Имя</th>\n",
|
||||||
|
" <th>Возраст</th>\n",
|
||||||
|
" <th>Баллы</th>\n",
|
||||||
|
" <th>Результат с бонусом</th>\n",
|
||||||
|
" <th>Категория</th>\n",
|
||||||
|
" </tr>\n",
|
||||||
|
" </thead>\n",
|
||||||
|
" <tbody>\n",
|
||||||
|
" <tr>\n",
|
||||||
|
" <th>0</th>\n",
|
||||||
|
" <td>Анна</td>\n",
|
||||||
|
" <td>21</td>\n",
|
||||||
|
" <td>89</td>\n",
|
||||||
|
" <td>102.35</td>\n",
|
||||||
|
" <td>Младше</td>\n",
|
||||||
|
" </tr>\n",
|
||||||
|
" <tr>\n",
|
||||||
|
" <th>1</th>\n",
|
||||||
|
" <td>Борис</td>\n",
|
||||||
|
" <td>22</td>\n",
|
||||||
|
" <td>76</td>\n",
|
||||||
|
" <td>87.40</td>\n",
|
||||||
|
" <td>Младше</td>\n",
|
||||||
|
" </tr>\n",
|
||||||
|
" <tr>\n",
|
||||||
|
" <th>2</th>\n",
|
||||||
|
" <td>Виктор</td>\n",
|
||||||
|
" <td>23</td>\n",
|
||||||
|
" <td>95</td>\n",
|
||||||
|
" <td>109.25</td>\n",
|
||||||
|
" <td>Старше</td>\n",
|
||||||
|
" </tr>\n",
|
||||||
|
" <tr>\n",
|
||||||
|
" <th>3</th>\n",
|
||||||
|
" <td>Галина</td>\n",
|
||||||
|
" <td>24</td>\n",
|
||||||
|
" <td>82</td>\n",
|
||||||
|
" <td>94.30</td>\n",
|
||||||
|
" <td>Старше</td>\n",
|
||||||
|
" </tr>\n",
|
||||||
|
" <tr>\n",
|
||||||
|
" <th>4</th>\n",
|
||||||
|
" <td>Дмитрий</td>\n",
|
||||||
|
" <td>21</td>\n",
|
||||||
|
" <td>91</td>\n",
|
||||||
|
" <td>104.65</td>\n",
|
||||||
|
" <td>Младше</td>\n",
|
||||||
|
" </tr>\n",
|
||||||
|
" </tbody>\n",
|
||||||
|
"</table>\n",
|
||||||
|
"</div>"
|
||||||
|
],
|
||||||
|
"text/plain": [
|
||||||
|
" Имя Возраст Баллы Результат с бонусом Категория\n",
|
||||||
|
"0 Анна 21 89 102.35 Младше\n",
|
||||||
|
"1 Борис 22 76 87.40 Младше\n",
|
||||||
|
"2 Виктор 23 95 109.25 Старше\n",
|
||||||
|
"3 Галина 24 82 94.30 Старше\n",
|
||||||
|
"4 Дмитрий 21 91 104.65 Младше"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"execution_count": 13,
|
||||||
|
"metadata": {},
|
||||||
|
"output_type": "execute_result"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"import pandas as pd\n",
|
||||||
|
"import numpy as np\n",
|
||||||
|
"\n",
|
||||||
|
"students_info = {\n",
|
||||||
|
" \"Имя\": [\"Анна\", \"Борис\", \"Виктор\", \"Галина\", \"Дмитрий\"],\n",
|
||||||
|
" \"Возраст\": [21, 22, 23, 24, 21],\n",
|
||||||
|
" \"Баллы\": [89, 76, 95, 82, 91]\n",
|
||||||
|
"}\n",
|
||||||
|
"df = pd.DataFrame(students_info)\n",
|
||||||
|
"\n",
|
||||||
|
"df[\"Результат с бонусом\"] = df[\"Баллы\"].apply(lambda x: round(x * 1.15, 2))\n",
|
||||||
|
"\n",
|
||||||
|
"df[\"Категория\"] = df[\"Возраст\"].apply(lambda age: \"Младше\" if age < 23 else \"Старше\")\n",
|
||||||
|
"\n",
|
||||||
|
"grouped_stats = df.groupby(\"Категория\").agg({\n",
|
||||||
|
" \"Баллы\": [\"mean\", \"max\", \"min\"],\n",
|
||||||
|
" \"Имя\": \"count\"\n",
|
||||||
|
"}).round(2)\n",
|
||||||
|
"\n",
|
||||||
|
"filtered_df = df[(df[\"Возраст\"] > 21) | (df[\"Баллы\"] > 80)]\n",
|
||||||
|
"\n",
|
||||||
|
"filtered_df = filtered_df.sort_values(\"Баллы\", ascending=False)\n",
|
||||||
|
"\n",
|
||||||
|
"print(\"Основная таблица с бонусами:\")\n",
|
||||||
|
"print(df)\n",
|
||||||
|
"\n",
|
||||||
|
"print(\"\\nСтатистика по группам:\")\n",
|
||||||
|
"print(grouped_stats)\n",
|
||||||
|
"\n",
|
||||||
|
"print(\"\\nОтфильтрованные студенты:\")\n",
|
||||||
|
"print(filtered_df)\n",
|
||||||
|
"\n",
|
||||||
|
"df"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "3edb05fc-37ae-44df-b4a2-9abdc9c8f541",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "f808c922-f97c-4d19-aab9-5447d932cc71",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"kernelspec": {
|
||||||
|
"display_name": "Python 3 (ipykernel)",
|
||||||
|
"language": "python",
|
||||||
|
"name": "python3"
|
||||||
|
},
|
||||||
|
"language_info": {
|
||||||
|
"codemirror_mode": {
|
||||||
|
"name": "ipython",
|
||||||
|
"version": 3
|
||||||
|
},
|
||||||
|
"file_extension": ".py",
|
||||||
|
"mimetype": "text/x-python",
|
||||||
|
"name": "python",
|
||||||
|
"nbconvert_exporter": "python",
|
||||||
|
"pygments_lexer": "ipython3",
|
||||||
|
"version": "3.13.5"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nbformat": 4,
|
||||||
|
"nbformat_minor": 5
|
||||||
|
}
|
||||||
121
seaborn.ipynb
Normal file
121
seaborn.ipynb
Normal file
File diff suppressed because one or more lines are too long
144
tqdm.ipynb
Normal file
144
tqdm.ipynb
Normal file
@ -0,0 +1,144 @@
|
|||||||
|
{
|
||||||
|
"cells": [
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 1,
|
||||||
|
"id": "1b768852-5883-4ca4-86e7-d4a93c9a1a55",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"Таблица создана:\n",
|
||||||
|
" ID Data\n",
|
||||||
|
"0 0 -1.082938\n",
|
||||||
|
"1 1 -0.374716\n",
|
||||||
|
"2 2 0.609893\n",
|
||||||
|
"3 3 0.032177\n",
|
||||||
|
"4 4 1.138623\n",
|
||||||
|
"\n",
|
||||||
|
"Запускаю цикл с прогресс-баром...\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "stderr",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"Загрузка: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████| 50/50 [00:02<00:00, 19.56it/s]\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"Первый цикл готов!\n",
|
||||||
|
"\n",
|
||||||
|
"Обрабатываю строки таблицы...\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "stderr",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"Обработка: 100it [00:00, 20892.13it/s]\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"Обработано строк: 100\n",
|
||||||
|
"\n",
|
||||||
|
"Запускаю второй прогресс-бар...\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "stderr",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"Вычисления: 100%|\u001b[34m████████████████████████████████████████████████████████████████████████████████████████████████████████\u001b[0m| 20/20 [00:02<00:00, 9.86it/s]\u001b[0m"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"Все вычисления завершены!\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "stderr",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"import pandas as pd\n",
|
||||||
|
"import numpy as np\n",
|
||||||
|
"from tqdm import tqdm\n",
|
||||||
|
"import time\n",
|
||||||
|
"\n",
|
||||||
|
"df = pd.DataFrame({\n",
|
||||||
|
" 'ID': range(100),\n",
|
||||||
|
" 'Data': np.random.randn(100)\n",
|
||||||
|
"})\n",
|
||||||
|
"\n",
|
||||||
|
"print(\"Таблица создана:\")\n",
|
||||||
|
"print(df.head())\n",
|
||||||
|
"\n",
|
||||||
|
"print(\"\\nЗапускаю цикл с прогресс-баром...\")\n",
|
||||||
|
"for i in tqdm(range(50), desc='Загрузка'):\n",
|
||||||
|
" time.sleep(0.05)\n",
|
||||||
|
"\n",
|
||||||
|
"print(\"Первый цикл готов!\")\n",
|
||||||
|
"\n",
|
||||||
|
"print(\"\\nОбрабатываю строки таблицы...\")\n",
|
||||||
|
"schetchik = 0\n",
|
||||||
|
"for index, row in tqdm(df.iterrows(), desc=\"Обработка\"):\n",
|
||||||
|
" vremya = row['Data'] ** 2\n",
|
||||||
|
" schetchik = schetchik + 1\n",
|
||||||
|
"\n",
|
||||||
|
"print(f\"Обработано строк: {schetchik}\")\n",
|
||||||
|
"\n",
|
||||||
|
"print(\"\\nЗапускаю второй прогресс-бар...\")\n",
|
||||||
|
"for i in tqdm(range(20), desc='Вычисления', colour='blue'):\n",
|
||||||
|
" result = i * 2\n",
|
||||||
|
" time.sleep(0.1)\n",
|
||||||
|
"\n",
|
||||||
|
"print(\"Все вычисления завершены!\")"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "fe6502c6-7248-4a62-9d1c-38fd51c85549",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"kernelspec": {
|
||||||
|
"display_name": "Python 3 (ipykernel)",
|
||||||
|
"language": "python",
|
||||||
|
"name": "python3"
|
||||||
|
},
|
||||||
|
"language_info": {
|
||||||
|
"codemirror_mode": {
|
||||||
|
"name": "ipython",
|
||||||
|
"version": 3
|
||||||
|
},
|
||||||
|
"file_extension": ".py",
|
||||||
|
"mimetype": "text/x-python",
|
||||||
|
"name": "python",
|
||||||
|
"nbconvert_exporter": "python",
|
||||||
|
"pygments_lexer": "ipython3",
|
||||||
|
"version": "3.13.5"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nbformat": 4,
|
||||||
|
"nbformat_minor": 5
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user