Compare commits
3 Commits
89475b7837
...
bb725a5a6d
| Author | SHA1 | Date | |
|---|---|---|---|
| bb725a5a6d | |||
| 94a97515b1 | |||
| b79d54143c |
4
.gitignore
vendored
4
.gitignore
vendored
@ -159,4 +159,6 @@ cython_debug/
|
|||||||
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
||||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||||
#.idea/
|
#.idea/
|
||||||
|
.idea
|
||||||
|
.ipynb_checkpoints
|
||||||
|
.venv
|
||||||
234
1111/Untitled.ipynb
Normal file
234
1111/Untitled.ipynb
Normal file
@ -0,0 +1,234 @@
|
|||||||
|
{
|
||||||
|
"cells": [
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 5,
|
||||||
|
"id": "59d7d25c-52ab-456a-a1c7-0d10884c68dd",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
" Имя Возраст Баллы\n",
|
||||||
|
"0 Анна 21 89\n",
|
||||||
|
"1 Борис 22 76\n",
|
||||||
|
"2 Виктор 23 95\n",
|
||||||
|
"3 Галина 24 82\n",
|
||||||
|
"<class 'pandas.DataFrame'>\n",
|
||||||
|
"RangeIndex: 4 entries, 0 to 3\n",
|
||||||
|
"Data columns (total 3 columns):\n",
|
||||||
|
" # Column Non-Null Count Dtype\n",
|
||||||
|
"--- ------ -------------- -----\n",
|
||||||
|
" 0 Имя 4 non-null str \n",
|
||||||
|
" 1 Возраст 4 non-null int64\n",
|
||||||
|
" 2 Баллы 4 non-null int64\n",
|
||||||
|
"dtypes: int64(2), str(1)\n",
|
||||||
|
"memory usage: 228.0 bytes\n",
|
||||||
|
"None\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"import pandas as pd\n",
|
||||||
|
"\n",
|
||||||
|
"#Создаем таблицу из твоего задания\n",
|
||||||
|
"data = {\n",
|
||||||
|
" \"Имя\": [\"Анна\", \"Борис\", \"Виктор\", \"Галина\"],\n",
|
||||||
|
" \"Возраст\": [21, 22, 23, 24],\n",
|
||||||
|
" \"Баллы\": [89, 76, 95, 82]\n",
|
||||||
|
"}\n",
|
||||||
|
"df = pd.DataFrame(data)\n",
|
||||||
|
"\n",
|
||||||
|
"#Проверяем структуру (методы из задания)\n",
|
||||||
|
"print(df.head())\n",
|
||||||
|
"print(df.info())"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 6,
|
||||||
|
"id": "abc54aaf-52d6-454e-b11e-0d39a350eedf",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"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",
|
||||||
|
" </tr>\n",
|
||||||
|
" </thead>\n",
|
||||||
|
" <tbody>\n",
|
||||||
|
" <tr>\n",
|
||||||
|
" <th>0</th>\n",
|
||||||
|
" <td>Анна</td>\n",
|
||||||
|
" <td>21</td>\n",
|
||||||
|
" <td>89</td>\n",
|
||||||
|
" </tr>\n",
|
||||||
|
" <tr>\n",
|
||||||
|
" <th>1</th>\n",
|
||||||
|
" <td>Борис</td>\n",
|
||||||
|
" <td>22</td>\n",
|
||||||
|
" <td>76</td>\n",
|
||||||
|
" </tr>\n",
|
||||||
|
" <tr>\n",
|
||||||
|
" <th>2</th>\n",
|
||||||
|
" <td>Виктор</td>\n",
|
||||||
|
" <td>23</td>\n",
|
||||||
|
" <td>95</td>\n",
|
||||||
|
" </tr>\n",
|
||||||
|
" <tr>\n",
|
||||||
|
" <th>3</th>\n",
|
||||||
|
" <td>Галина</td>\n",
|
||||||
|
" <td>24</td>\n",
|
||||||
|
" <td>82</td>\n",
|
||||||
|
" </tr>\n",
|
||||||
|
" </tbody>\n",
|
||||||
|
"</table>\n",
|
||||||
|
"</div>"
|
||||||
|
],
|
||||||
|
"text/plain": [
|
||||||
|
" Имя Возраст Баллы\n",
|
||||||
|
"0 Анна 21 89\n",
|
||||||
|
"1 Борис 22 76\n",
|
||||||
|
"2 Виктор 23 95\n",
|
||||||
|
"3 Галина 24 82"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"execution_count": 6,
|
||||||
|
"metadata": {},
|
||||||
|
"output_type": "execute_result"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"df"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 7,
|
||||||
|
"id": "4f4d214a-1464-454e-a1bc-13033776437c",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"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",
|
||||||
|
" </tr>\n",
|
||||||
|
" </thead>\n",
|
||||||
|
" <tbody>\n",
|
||||||
|
" <tr>\n",
|
||||||
|
" <th>1</th>\n",
|
||||||
|
" <td>Борис</td>\n",
|
||||||
|
" <td>22</td>\n",
|
||||||
|
" <td>76</td>\n",
|
||||||
|
" <td>83.6</td>\n",
|
||||||
|
" </tr>\n",
|
||||||
|
" <tr>\n",
|
||||||
|
" <th>2</th>\n",
|
||||||
|
" <td>Виктор</td>\n",
|
||||||
|
" <td>23</td>\n",
|
||||||
|
" <td>95</td>\n",
|
||||||
|
" <td>104.5</td>\n",
|
||||||
|
" </tr>\n",
|
||||||
|
" <tr>\n",
|
||||||
|
" <th>3</th>\n",
|
||||||
|
" <td>Галина</td>\n",
|
||||||
|
" <td>24</td>\n",
|
||||||
|
" <td>82</td>\n",
|
||||||
|
" <td>90.2</td>\n",
|
||||||
|
" </tr>\n",
|
||||||
|
" </tbody>\n",
|
||||||
|
"</table>\n",
|
||||||
|
"</div>"
|
||||||
|
],
|
||||||
|
"text/plain": [
|
||||||
|
" Имя Возраст Баллы Новый столбец\n",
|
||||||
|
"1 Борис 22 76 83.6\n",
|
||||||
|
"2 Виктор 23 95 104.5\n",
|
||||||
|
"3 Галина 24 82 90.2"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"execution_count": 7,
|
||||||
|
"metadata": {},
|
||||||
|
"output_type": "execute_result"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"df[\"Новый столбец\"] = df[\"Баллы\"] * 1.1\n",
|
||||||
|
"df\n",
|
||||||
|
"df.groupby(\"Имя\").agg({\"Баллы\": \"mean\"})\n",
|
||||||
|
"df[df[\"Возраст\"] > 21]"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "43f172bb-235f-465a-8b87-14f6c734bef2",
|
||||||
|
"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.7"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nbformat": 4,
|
||||||
|
"nbformat_minor": 5
|
||||||
|
}
|
||||||
86
1111/Untitled1.ipynb
Normal file
86
1111/Untitled1.ipynb
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
{
|
||||||
|
"cells": [
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 3,
|
||||||
|
"id": "8b3cf142-a97b-418f-be08-18310b19211b",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"Матрица 2x3:\n",
|
||||||
|
" [[1 2 3]\n",
|
||||||
|
" [4 5 6]]\n",
|
||||||
|
"Форма (shape): (2, 3)\n",
|
||||||
|
"------------------------------\n",
|
||||||
|
"Равномерная шкала (linspace):\n",
|
||||||
|
" [0. 0.55555556 1.11111111 1.66666667 2.22222222 2.77777778\n",
|
||||||
|
" 3.33333333 3.88888889 4.44444444 5. ]\n",
|
||||||
|
"------------------------------\n",
|
||||||
|
"Случайная матрица 2x2:\n",
|
||||||
|
" [[ 0.19881164 -0.06385133]\n",
|
||||||
|
" [-0.15785181 -1.76408788]]\n",
|
||||||
|
"------------------------------\n",
|
||||||
|
"Результат матричного умножения A и B:\n",
|
||||||
|
" [[19 22]\n",
|
||||||
|
" [43 50]]\n",
|
||||||
|
"------------------------------\n",
|
||||||
|
"Сумма по столбцам матрицы: [5 7 9]\n",
|
||||||
|
"Среднее по строкам матрицы: [2. 5.]\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"import numpy as np\n",
|
||||||
|
"matrix = np.array([[1, 2, 3], [4, 5, 6]])\n",
|
||||||
|
"print(\"Матрица 2x3:\\n\", matrix)\n",
|
||||||
|
"print(\"Форма (shape):\", matrix.shape)\n",
|
||||||
|
"print(\"-\" * 30)\n",
|
||||||
|
"linear_space = np.linspace(0, 5, 10)\n",
|
||||||
|
"print(\"Равномерная шкала (linspace):\\n\", linear_space)\n",
|
||||||
|
"print(\"-\" * 30)\n",
|
||||||
|
"random_matrix = np.random.randn(2, 2)\n",
|
||||||
|
"print(\"Случайная матрица 2x2:\\n\", random_matrix)\n",
|
||||||
|
"print(\"-\" * 30)\n",
|
||||||
|
"A = np.array([[1, 2], [3, 4]])\n",
|
||||||
|
"B = np.array([[5, 6], [7, 8]])\n",
|
||||||
|
"dot_product = np.dot(A, B)\n",
|
||||||
|
"print(\"Результат матричного умножения A и B:\\n\", dot_product)\n",
|
||||||
|
"print(\"-\" * 30)\n",
|
||||||
|
"print(\"Сумма по столбцам матрицы:\", matrix.sum(axis=0))\n",
|
||||||
|
"print(\"Среднее по строкам матрицы:\", matrix.mean(axis=1))\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "4b2c508b-6345-4902-8e15-44fd3c36d9f5",
|
||||||
|
"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.7"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nbformat": 4,
|
||||||
|
"nbformat_minor": 5
|
||||||
|
}
|
||||||
79
1111/Untitled2.ipynb
Normal file
79
1111/Untitled2.ipynb
Normal file
File diff suppressed because one or more lines are too long
106
1111/Untitled3.ipynb
Normal file
106
1111/Untitled3.ipynb
Normal file
File diff suppressed because one or more lines are too long
118
1111/Untitled6.ipynb
Normal file
118
1111/Untitled6.ipynb
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
{
|
||||||
|
"cells": [
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 1,
|
||||||
|
"id": "4abcde78-eedd-4527-979d-f00d7d06e238",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"Начинаем обработку DataFrame...\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"application/vnd.jupyter.widget-view+json": {
|
||||||
|
"model_id": "322566ded7d94e769f950ad4e5047e4b",
|
||||||
|
"version_major": 2,
|
||||||
|
"version_minor": 0
|
||||||
|
},
|
||||||
|
"text/plain": [
|
||||||
|
"Анализ строк: 0%| | 0/100 [00:00<?, ?it/s]"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"metadata": {},
|
||||||
|
"output_type": "display_data"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"\n",
|
||||||
|
"==============================\n",
|
||||||
|
"\n",
|
||||||
|
"Запуск кастомного процесса...\n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"application/vnd.jupyter.widget-view+json": {
|
||||||
|
"model_id": "27a3ec943a1845a48c1b164574a41950",
|
||||||
|
"version_major": 2,
|
||||||
|
"version_minor": 0
|
||||||
|
},
|
||||||
|
"text/plain": [
|
||||||
|
"Загрузка нейросети: 0%| | 0/100 [00:00<?, ? слоев/s]"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"metadata": {},
|
||||||
|
"output_type": "display_data"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "stdout",
|
||||||
|
"output_type": "stream",
|
||||||
|
"text": [
|
||||||
|
"Готово!\n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"import pandas as pd\n",
|
||||||
|
"import numpy as np\n",
|
||||||
|
"from tqdm.auto import tqdm \n",
|
||||||
|
"import time\n",
|
||||||
|
"df = pd.DataFrame({\n",
|
||||||
|
" 'ID': range(1, 101),\n",
|
||||||
|
" 'Data': np.random.randn(100)\n",
|
||||||
|
"})\n",
|
||||||
|
"print(\"Начинаем обработку DataFrame...\")\n",
|
||||||
|
"for index, row in tqdm(df.iterrows(), total=df.shape[0], desc=\"Анализ строк\"):\n",
|
||||||
|
" # Симуляция сложной математики\n",
|
||||||
|
" time.sleep(0.02) \n",
|
||||||
|
" \n",
|
||||||
|
"print(\"\\n\" + \"=\"*30 + \"\\n\")\n",
|
||||||
|
"print(\"Запуск кастомного процесса...\")\n",
|
||||||
|
"\n",
|
||||||
|
"for i in tqdm(range(100), \n",
|
||||||
|
" desc='Загрузка нейросети', \n",
|
||||||
|
" unit=' слоев', \n",
|
||||||
|
" colour='green'):\n",
|
||||||
|
" time.sleep(0.03)\n",
|
||||||
|
"\n",
|
||||||
|
"print(\"Готово!\")"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "0dd78fa7-8710-4642-8a58-38b0913c9b25",
|
||||||
|
"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.7"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nbformat": 4,
|
||||||
|
"nbformat_minor": 5
|
||||||
|
}
|
||||||
612
1111/Untitled7.ipynb
Normal file
612
1111/Untitled7.ipynb
Normal file
File diff suppressed because one or more lines are too long
26
1111/top_movies.csv
Normal file
26
1111/top_movies.csv
Normal 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
|
||||||
|
Loading…
Reference in New Issue
Block a user