Compare commits

..

2 Commits

Author SHA1 Message Date
97c71c61d6 LABA_2 2026-05-06 13:12:04 +03:00
7853715ecb Скелет 2026-05-06 13:12:00 +03:00
18 changed files with 1016 additions and 3 deletions

2
.idea/KRUK.iml generated
View File

@ -1,8 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4"> <module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager"> <component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.13" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
</component> </component>
</module> </module>

1
.idea/misc.xml generated
View File

@ -3,5 +3,4 @@
<component name="Black"> <component name="Black">
<option name="sdkName" value="Python 3.13" /> <option name="sdkName" value="Python 3.13" />
</component> </component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.13" project-jdk-type="Python SDK" />
</project> </project>

View File

@ -0,0 +1,13 @@
{
"cells": [
{
"metadata": {},
"cell_type": "raw",
"source": "",
"id": "c356642a86006994"
}
],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 5
}

View File

@ -0,0 +1,13 @@
{
"cells": [
{
"metadata": {},
"cell_type": "raw",
"source": "",
"id": "cae5a158a0ceef9e"
}
],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 5
}

View File

@ -0,0 +1,13 @@
{
"cells": [
{
"metadata": {},
"cell_type": "raw",
"source": "",
"id": "d69266a0f4afa5c9"
}
],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 5
}

View File

@ -0,0 +1,13 @@
{
"cells": [
{
"metadata": {},
"cell_type": "raw",
"source": "",
"id": "f84d5ad7321ebb7b"
}
],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 5
}

View File

@ -0,0 +1,13 @@
{
"cells": [
{
"metadata": {},
"cell_type": "raw",
"source": "",
"id": "5851d5dbe1210fce"
}
],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 5
}

View File

@ -0,0 +1,13 @@
{
"cells": [
{
"metadata": {},
"cell_type": "raw",
"source": "",
"id": "d236d4fb7f0e2dd3"
}
],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 5
}

View File

@ -0,0 +1,13 @@
{
"cells": [
{
"metadata": {},
"cell_type": "raw",
"source": "",
"id": "de0d70db355bb5c5"
}
],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 5
}

13
2LABA.ipynb Normal file
View File

@ -0,0 +1,13 @@
{
"cells": [
{
"metadata": {},
"cell_type": "raw",
"source": "",
"id": "6bd3d2c648b71e8d"
}
],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 5
}

13
Untitled.ipynb Normal file
View File

@ -0,0 +1,13 @@
{
"cells": [
{
"metadata": {},
"cell_type": "raw",
"source": "",
"id": "6bd3d2c648b71e8d"
}
],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 5
}

343
Untitled1.ipynb Normal file

File diff suppressed because one or more lines are too long

95
matplotlib.ipynb Normal file

File diff suppressed because one or more lines are too long

107
numpy.ipynb Normal file
View File

@ -0,0 +1,107 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "f75546c6-5eb9-4b1e-be1a-ec2bf162b848",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"--- 1. Двумерный массив ---\n",
"[[1 2]\n",
" [3 4]]\n",
"\n",
"--- 2. Равномерные интервалы (linspace) ---\n",
"[0. 0.55555556 1.11111111 1.66666667 2.22222222 2.77777778\n",
" 3.33333333 3.88888889 4.44444444 5. ]\n",
"\n",
"--- 3. Случайные числа (randn) ---\n",
"[[-0.54989953 -0.65009822]\n",
" [-0.65433968 0.85084421]]\n",
"\n",
"--- 4. Результат np.dot() ---\n",
"[[-1.8585789 1.0515902 ]\n",
" [-4.26705733 1.45308217]]\n"
]
},
{
"data": {
"text/plain": [
"array([[-1.8585789 , 1.0515902 ],\n",
" [-4.26705733, 1.45308217]])"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import numpy as np\n",
"\n",
"# 1. Создание двумерного массива (матрицы 2x2)\n",
"matrix_2x2 = np.array([[1, 2], [3, 4]])\n",
"\n",
"# 2. Использование np.linspace() \n",
"# Создаем 10 равномерно распределенных чисел от 0 до 5\n",
"lin_points = np.linspace(0, 5, 10)\n",
"\n",
"# 3. Использование np.random.randn()\n",
"# Генерируем случайную матрицу 2x2 из нормального распределения\n",
"random_matrix = np.random.randn(2, 2)\n",
"\n",
"# 4. Использование np.dot()\n",
"# Выполняем умножение двух матриц (нашей первой матрицы и случайной)\n",
"matrix_product = np.dot(matrix_2x2, random_matrix)\n",
"\n",
"# Вывод всех результатов\n",
"print(\"--- 1. Двумерный массив ---\")\n",
"print(matrix_2x2)\n",
"\n",
"print(\"\\n--- 2. Равномерные интервалы (linspace) ---\")\n",
"print(lin_points)\n",
"\n",
"print(\"\\n--- 3. Случайные числа (randn) ---\")\n",
"print(random_matrix)\n",
"\n",
"print(\"\\n--- 4. Результат np.dot() ---\")\n",
"print(matrix_product)\n",
"\n",
"# Последняя строчка для отображения в интерактивной среде\n",
"matrix_product"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e7ad4d46-abc8-4dea-b290-1f6c73ca06ed",
"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
}

31
pandas.ipynb Normal file
View File

@ -0,0 +1,31 @@
{
"cells": [
{
"cell_type": "raw",
"id": "d3aefaad2d76b7cf",
"metadata": {},
"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
}

131
seaborn.ipynb Normal file

File diff suppressed because one or more lines are too long

26
top_movies.csv Normal file
View File

@ -0,0 +1,26 @@
title,popularity,vote_average,vote_count,release_year
The Shawshank Redemption,85.5,8.7,21000,1994
The Godfather,70.2,8.7,16000,1972
The Dark Knight,92.1,8.5,27000,2008
Inception,120.4,8.3,31000,2010
Pulp Fiction,65.8,8.5,23000,1994
Interstellar,150.2,8.3,28000,2014
The Matrix,75.4,8.2,24000,1999
Forrest Gump,55.9,8.2,22000,1994
Avengers: Endgame,250.7,8.3,20000,2019
Spider-Man: No Way Home,310.5,8.1,15000,2021
Parasite,45.3,8.5,12000,2019
The Lion King,35.2,8.2,14000,1994
Fight Club,60.1,8.4,24000,1999
Spirited Away,38.7,8.5,11000,2001
Gladiator,42.5,8.2,15000,2000
Joker,180.3,8.2,19000,2019
The Green Mile,30.2,8.5,13000,1999
Titanic,110.1,7.9,21000,1997
Avatar,140.8,7.5,25000,2009
The Wolf of Wall Street,95.4,8.0,18000,2013
Star Wars: A New Hope,50.2,8.2,17000,1977
Mad Max: Fury Road,88.1,8.1,19000,2015
La La Land,40.5,7.9,14000,2016
The Silence of the Lambs,33.2,8.3,13000,1991
Goodfellas,28.4,8.5,10000,1990
1 title popularity vote_average vote_count release_year
2 The Shawshank Redemption 85.5 8.7 21000 1994
3 The Godfather 70.2 8.7 16000 1972
4 The Dark Knight 92.1 8.5 27000 2008
5 Inception 120.4 8.3 31000 2010
6 Pulp Fiction 65.8 8.5 23000 1994
7 Interstellar 150.2 8.3 28000 2014
8 The Matrix 75.4 8.2 24000 1999
9 Forrest Gump 55.9 8.2 22000 1994
10 Avengers: Endgame 250.7 8.3 20000 2019
11 Spider-Man: No Way Home 310.5 8.1 15000 2021
12 Parasite 45.3 8.5 12000 2019
13 The Lion King 35.2 8.2 14000 1994
14 Fight Club 60.1 8.4 24000 1999
15 Spirited Away 38.7 8.5 11000 2001
16 Gladiator 42.5 8.2 15000 2000
17 Joker 180.3 8.2 19000 2019
18 The Green Mile 30.2 8.5 13000 1999
19 Titanic 110.1 7.9 21000 1997
20 Avatar 140.8 7.5 25000 2009
21 The Wolf of Wall Street 95.4 8.0 18000 2013
22 Star Wars: A New Hope 50.2 8.2 17000 1977
23 Mad Max: Fury Road 88.1 8.1 19000 2015
24 La La Land 40.5 7.9 14000 2016
25 The Silence of the Lambs 33.2 8.3 13000 1991
26 Goodfellas 28.4 8.5 10000 1990

166
tqdm.ipynb Normal file
View File

@ -0,0 +1,166 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "13714da7-099c-4820-9a4c-02bb3a0f2aad",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Запуск обработки данных с tqdm...\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Обработка строк: 100%|\u001b[32m███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████\u001b[0m| 1000/1000 [00:05<00:00, 169.78row/s]\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Обработка завершена!\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Общий прогресс: 0%| | 0/5 [00:00<?, ?it/s]\n",
"Этап 1: 0%| | 0/100 [00:00<?, ?it/s]\u001b[A\n",
"Этап 1: 10%|██████████████████ | 10/100 [00:00<00:00, 91.48it/s]\u001b[A\n",
"Этап 1: 20%|████████████████████████████████████▏ | 20/100 [00:00<00:00, 91.39it/s]\u001b[A\n",
"Этап 1: 30%|██████████████████████████████████████████████████████▎ | 30/100 [00:00<00:00, 91.50it/s]\u001b[A\n",
"Этап 1: 40%|████████████████████████████████████████████████████████████████████████▍ | 40/100 [00:00<00:00, 91.38it/s]\u001b[A\n",
"Этап 1: 50%|██████████████████████████████████████████████████████████████████████████████████████████▌ | 50/100 [00:00<00:00, 91.72it/s]\u001b[A\n",
"Этап 1: 60%|████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 60/100 [00:00<00:00, 91.47it/s]\u001b[A\n",
"Этап 1: 70%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 70/100 [00:00<00:00, 91.24it/s]\u001b[A\n",
"Этап 1: 80%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 80/100 [00:00<00:00, 91.28it/s]\u001b[A\n",
"Этап 1: 90%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 90/100 [00:00<00:00, 91.83it/s]\u001b[A\n",
"Этап 1: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 100/100 [00:01<00:00, 91.82it/s]\u001b[A\n",
"Общий прогресс: 20%|███████████████████████████████████▏ | 1/5 [00:01<00:04, 1.10s/it]\u001b[A\n",
"Этап 2: 0%| | 0/100 [00:00<?, ?it/s]\u001b[A\n",
"Этап 2: 10%|██████████████████ | 10/100 [00:00<00:00, 93.49it/s]\u001b[A\n",
"Этап 2: 20%|████████████████████████████████████▏ | 20/100 [00:00<00:00, 92.26it/s]\u001b[A\n",
"Этап 2: 30%|██████████████████████████████████████████████████████▎ | 30/100 [00:00<00:00, 92.55it/s]\u001b[A\n",
"Этап 2: 40%|████████████████████████████████████████████████████████████████████████▍ | 40/100 [00:00<00:00, 91.98it/s]\u001b[A\n",
"Этап 2: 50%|██████████████████████████████████████████████████████████████████████████████████████████▌ | 50/100 [00:00<00:00, 91.01it/s]\u001b[A\n",
"Этап 2: 60%|████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 60/100 [00:00<00:00, 91.48it/s]\u001b[A\n",
"Этап 2: 70%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 70/100 [00:00<00:00, 91.42it/s]\u001b[A\n",
"Этап 2: 80%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 80/100 [00:00<00:00, 91.67it/s]\u001b[A\n",
"Этап 2: 90%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 90/100 [00:00<00:00, 91.75it/s]\u001b[A\n",
"Этап 2: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 100/100 [00:01<00:00, 91.85it/s]\u001b[A\n",
"Общий прогресс: 40%|██████████████████████████████████████████████████████████████████████▍ | 2/5 [00:02<00:03, 1.10s/it]\u001b[A\n",
"Этап 3: 0%| | 0/100 [00:00<?, ?it/s]\u001b[A\n",
"Этап 3: 10%|██████████████████ | 10/100 [00:00<00:00, 94.04it/s]\u001b[A\n",
"Этап 3: 20%|████████████████████████████████████▏ | 20/100 [00:00<00:00, 92.75it/s]\u001b[A\n",
"Этап 3: 30%|██████████████████████████████████████████████████████▎ | 30/100 [00:00<00:00, 92.43it/s]\u001b[A\n",
"Этап 3: 40%|████████████████████████████████████████████████████████████████████████▍ | 40/100 [00:00<00:00, 91.80it/s]\u001b[A\n",
"Этап 3: 50%|██████████████████████████████████████████████████████████████████████████████████████████▌ | 50/100 [00:00<00:00, 91.91it/s]\u001b[A\n",
"Этап 3: 60%|████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 60/100 [00:00<00:00, 91.83it/s]\u001b[A\n",
"Этап 3: 70%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 70/100 [00:00<00:00, 92.02it/s]\u001b[A\n",
"Этап 3: 80%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 80/100 [00:00<00:00, 91.79it/s]\u001b[A\n",
"Этап 3: 90%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 90/100 [00:00<00:00, 92.07it/s]\u001b[A\n",
"Этап 3: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 100/100 [00:01<00:00, 91.84it/s]\u001b[A\n",
"Общий прогресс: 60%|█████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 3/5 [00:03<00:02, 1.10s/it]\u001b[A\n",
"Этап 4: 0%| | 0/100 [00:00<?, ?it/s]\u001b[A\n",
"Этап 4: 10%|██████████████████ | 10/100 [00:00<00:00, 95.57it/s]\u001b[A\n",
"Этап 4: 20%|████████████████████████████████████▏ | 20/100 [00:00<00:00, 92.96it/s]\u001b[A\n",
"Этап 4: 30%|██████████████████████████████████████████████████████▎ | 30/100 [00:00<00:00, 92.42it/s]\u001b[A\n",
"Этап 4: 40%|████████████████████████████████████████████████████████████████████████▍ | 40/100 [00:00<00:00, 92.03it/s]\u001b[A\n",
"Этап 4: 50%|██████████████████████████████████████████████████████████████████████████████████████████▌ | 50/100 [00:00<00:00, 91.90it/s]\u001b[A\n",
"Этап 4: 60%|████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 60/100 [00:00<00:00, 91.83it/s]\u001b[A\n",
"Этап 4: 70%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 70/100 [00:00<00:00, 92.30it/s]\u001b[A\n",
"Этап 4: 80%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 80/100 [00:00<00:00, 92.39it/s]\u001b[A\n",
"Этап 4: 90%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 90/100 [00:00<00:00, 92.15it/s]\u001b[A\n",
"Этап 4: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 100/100 [00:01<00:00, 92.07it/s]\u001b[A\n",
"Общий прогресс: 80%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 4/5 [00:04<00:01, 1.09s/it]\u001b[A\n",
"Этап 5: 0%| | 0/100 [00:00<?, ?it/s]\u001b[A\n",
"Этап 5: 10%|██████████████████ | 10/100 [00:00<00:00, 94.20it/s]\u001b[A\n",
"Этап 5: 20%|████████████████████████████████████▏ | 20/100 [00:00<00:00, 93.14it/s]\u001b[A\n",
"Этап 5: 30%|██████████████████████████████████████████████████████▎ | 30/100 [00:00<00:00, 92.40it/s]\u001b[A\n",
"Этап 5: 40%|████████████████████████████████████████████████████████████████████████▍ | 40/100 [00:00<00:00, 92.30it/s]\u001b[A\n",
"Этап 5: 50%|██████████████████████████████████████████████████████████████████████████████████████████▌ | 50/100 [00:00<00:00, 92.35it/s]\u001b[A\n",
"Этап 5: 60%|████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 60/100 [00:00<00:00, 92.47it/s]\u001b[A\n",
"Этап 5: 70%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 70/100 [00:00<00:00, 92.34it/s]\u001b[A\n",
"Этап 5: 80%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 80/100 [00:00<00:00, 92.37it/s]\u001b[A\n",
"Этап 5: 90%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 90/100 [00:00<00:00, 92.20it/s]\u001b[A\n",
"Этап 5: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 100/100 [00:01<00:00, 92.47it/s]\u001b[A\n",
"Общий прогресс: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:05<00:00, 1.09s/it]\u001b[A\n"
]
}
],
"source": [
"import pandas as pd\n",
"import numpy as np\n",
"from tqdm import tqdm\n",
"import time\n",
"\n",
"# 1. Подготовка данных (создаем DataFrame на 1000 строк)\n",
"df = pd.DataFrame({\n",
" 'ID': range(1000),\n",
" 'Data': np.random.randn(1000)\n",
"})\n",
"\n",
"print(\"Запуск обработки данных с tqdm...\")\n",
"\n",
"# 2. Использование tqdm для итерации по DataFrame (iterrows)\n",
"# Добавляем кастомную стилизацию через аргументы:\n",
"# desc — описание процесса\n",
"# unit — единица измерения\n",
"# colour — цвет бара (поддерживается в современных терминалах/ноутбуках)\n",
"for index, row in tqdm(df.iterrows(), \n",
" total=df.shape[0], \n",
" desc=\"Обработка строк\", \n",
" unit=\"row\", \n",
" colour=\"green\"):\n",
" \n",
" # Симуляция сложной обработки данных\n",
" time.sleep(0.005) \n",
" _ = row['Data'] ** 2\n",
"\n",
"print(\"\\nОбработка завершена!\")\n",
"\n",
"# 3. Пример с вложенным циклом и кастомным описанием\n",
"for i in tqdm(range(5), desc=\"Общий прогресс\", position=0):\n",
" for j in tqdm(range(100), desc=f\"Этап {i+1}\", position=1, leave=False):\n",
" time.sleep(0.01)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "834b60ab-68b9-48ed-9223-3b2a1b3b186e",
"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
}