Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,276 changes: 4,276 additions & 0 deletions RealEstatePricePredictionMoscow02.ipynb

Large diffs are not rendered by default.

4,304 changes: 4,304 additions & 0 deletions RealEstatePricePredictionMoscow03.ipynb

Large diffs are not rendered by default.

125 changes: 125 additions & 0 deletions lesson01_NumPy01.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 46,
"id": "14f56e8d",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Исходный массив :\n",
"[[ 1 2 3 3 1]\n",
" [ 6 8 11 10 7]]\n",
"Усредненный массив :\n",
"[2. 8.4]\n"
]
}
],
"source": [
"import numpy as np\n",
"a = np.array([\n",
" [1, 2, 3, 3, 1],\n",
" [6, 8, 11, 10, 7]\n",
" ])\n",
"\n",
"print(\"Исходный массив :\")\n",
"print(a)\n",
"\n",
"mean_a = a.mean(axis=1)\n",
"print(\"Усредненный массив :\")\n",
"print(mean_a)"
]
},
{
"cell_type": "code",
"execution_count": 76,
"id": "4744d693",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Центрированный массив:\n",
"[[-1. -2.4]\n",
" [ 0. -0.4]\n",
" [ 1. 2.6]\n",
" [ 1. 1.6]\n",
" [-1. -1.4]]\n"
]
}
],
"source": [
"np.shape(a)\n",
"np.shape(mean_a)\n",
"a_centered = np.array(a.T - mean_a)\n",
"print(\"Центрированный массив:\")\n",
"print(a_centered)"
]
},
{
"cell_type": "code",
"execution_count": 96,
"id": "0736a48d",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(5, 2)\n",
"[[-1.]\n",
" [ 0.]\n",
" [ 1.]\n",
" [ 1.]\n",
" [-1.]]\n",
"[[-2.4]\n",
" [-0.4]\n",
" [ 2.6]\n",
" [ 1.6]\n",
" [-1.4]]\n",
"скалярное произведение столбцов:\n",
"8.0\n"
]
}
],
"source": [
"print(np.shape(a_centered))\n",
"\n",
"a1 = np.array(a_centered[0:, 0:1])\n",
"print(a1)\n",
"\n",
"a2 = np.array(a_centered[0:, 1:2])\n",
"print(a2)\n",
"\n",
"a_centered_sp = np.dot(a1.flatten(), a2.flatten())\n",
"print(\"скалярное произведение столбцов:\")\n",
"print(a_centered_sp)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.9.1"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading