Browse Source

Fix some type errors

pull/2/MERGE
bushuhui 4 years ago
parent
commit
94c90759c2
8 changed files with 308 additions and 307 deletions
  1. +5
    -5
      0_python/5_Control_Flow.ipynb
  2. +37
    -37
      0_python/6_Function.ipynb
  3. +84
    -79
      0_python/7_Class.ipynb
  4. +172
    -176
      1_numpy_matplotlib_scipy_sympy/1-numpy_tutorial.ipynb
  5. +3
    -3
      1_numpy_matplotlib_scipy_sympy/random-matrix.csv
  6. BIN
      1_numpy_matplotlib_scipy_sympy/random-matrix.npy
  7. +4
    -4
      README.md
  8. +3
    -3
      tips/InstallPython.md

+ 5
- 5
0_python/5_Control_Flow.ipynb View File

@@ -25,7 +25,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 1,
"metadata": {},
"outputs": [
{
@@ -38,9 +38,9 @@
],
"source": [
"x = 4\n",
"if x >10:\n",
"if x >10: \n",
" print(\"Hello\")\n",
"else:\n",
"else: \n",
" print(\"Welcome!\")"
]
},
@@ -194,7 +194,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 2,
"metadata": {},
"outputs": [
{
@@ -216,7 +216,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 3,
"metadata": {},
"outputs": [
{


+ 37
- 37
0_python/6_Function.ipynb View File

@@ -78,7 +78,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 3,
"metadata": {},
"outputs": [
{
@@ -107,7 +107,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
@@ -118,14 +118,14 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Please enter your name : Willam\n"
"Please enter your name : Jack\n"
]
}
],
@@ -142,15 +142,15 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Hey Willam!\n",
"Willam, How do you do?\n"
"Hey Jack!\n",
"Jack, How do you do?\n"
]
}
],
@@ -167,7 +167,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
@@ -214,7 +214,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
@@ -232,7 +232,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 9,
"metadata": {},
"outputs": [
{
@@ -264,7 +264,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
@@ -275,7 +275,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 11,
"metadata": {},
"outputs": [
{
@@ -300,7 +300,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 12,
"metadata": {},
"outputs": [
{
@@ -321,7 +321,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
@@ -337,7 +337,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
@@ -346,7 +346,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
@@ -367,7 +367,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 16,
"metadata": {},
"outputs": [
{
@@ -385,7 +385,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 18,
"metadata": {},
"outputs": [
{
@@ -650,7 +650,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 23,
"metadata": {},
"outputs": [],
"source": [
@@ -666,7 +666,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 24,
"metadata": {},
"outputs": [],
"source": [
@@ -686,7 +686,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 25,
"metadata": {},
"outputs": [
{
@@ -732,7 +732,7 @@
},
{
"cell_type": "code",
"execution_count": 48,
"execution_count": 26,
"metadata": {},
"outputs": [],
"source": [
@@ -761,7 +761,7 @@
},
{
"cell_type": "code",
"execution_count": 50,
"execution_count": 27,
"metadata": {},
"outputs": [
{
@@ -770,7 +770,7 @@
"(6, 8)"
]
},
"execution_count": 50,
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
@@ -782,7 +782,7 @@
},
{
"cell_type": "code",
"execution_count": 51,
"execution_count": 28,
"metadata": {},
"outputs": [
{
@@ -791,7 +791,7 @@
"function"
]
},
"execution_count": 51,
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
@@ -802,7 +802,7 @@
},
{
"cell_type": "code",
"execution_count": 52,
"execution_count": 29,
"metadata": {},
"outputs": [
{
@@ -811,7 +811,7 @@
"function"
]
},
"execution_count": 52,
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
@@ -839,7 +839,7 @@
},
{
"cell_type": "code",
"execution_count": 53,
"execution_count": 30,
"metadata": {},
"outputs": [],
"source": [
@@ -848,7 +848,7 @@
},
{
"cell_type": "code",
"execution_count": 54,
"execution_count": 31,
"metadata": {},
"outputs": [
{
@@ -866,7 +866,7 @@
},
{
"cell_type": "code",
"execution_count": 55,
"execution_count": 32,
"metadata": {},
"outputs": [
{
@@ -900,7 +900,7 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": 38,
"metadata": {},
"outputs": [
{
@@ -913,7 +913,7 @@
],
"source": [
"eg2 = map(lambda x,y:x+y, list1,list2)\n",
"print(eg2)"
"print(list(eg2))"
]
},
{
@@ -925,14 +925,14 @@
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": 39,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['10', '10', '10', '10', '10', '10', '10', '10', '10']\n"
"<map object at 0x7f75c27604a8>\n"
]
}
],
@@ -957,7 +957,7 @@
},
{
"cell_type": "code",
"execution_count": 56,
"execution_count": 40,
"metadata": {},
"outputs": [],
"source": [
@@ -973,7 +973,7 @@
},
{
"cell_type": "code",
"execution_count": 57,
"execution_count": 41,
"metadata": {},
"outputs": [
{


+ 84
- 79
0_python/7_Class.ipynb View File

@@ -25,9 +25,11 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"```\n",
"class class_name:\n",
"\n",
" Functions"
" Functions\n",
"```"
]
},
{
@@ -36,6 +38,7 @@
"metadata": {},
"outputs": [],
"source": [
"# 一个最简单的类\n",
"class FirstClass:\n",
" pass\n"
]
@@ -128,7 +131,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 5,
"metadata": {},
"outputs": [
{
@@ -136,9 +139,9 @@
"evalue": "'FirstClass' object has no attribute 'init'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-8-d15e7b8e3d78>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0meg0\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mFirstClass\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0meg0\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minit\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31m-----------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-5-d15e7b8e3d78>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0meg0\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mFirstClass\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0meg0\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minit\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m: 'FirstClass' object has no attribute 'init'"
]
}
@@ -166,12 +169,13 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"class FirstClass:\n",
" \"\"\"My first class\"\"\"\n",
" class_var = 10\n",
" def __init__(self,name,symbol):\n",
" self.name = name\n",
" self.symbol = symbol"
@@ -186,7 +190,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
@@ -196,14 +200,14 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"onex 11\n",
"one 1\n",
"two 2\n",
"My first class\n"
]
@@ -224,7 +228,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 14,
"metadata": {
"scrolled": false
},
@@ -244,6 +248,7 @@
" '__gt__',\n",
" '__hash__',\n",
" '__init__',\n",
" '__init_subclass__',\n",
" '__le__',\n",
" '__lt__',\n",
" '__module__',\n",
@@ -256,10 +261,11 @@
" '__sizeof__',\n",
" '__str__',\n",
" '__subclasshook__',\n",
" '__weakref__']"
" '__weakref__',\n",
" 'class_var']"
]
},
"execution_count": 16,
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
@@ -270,7 +276,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 10,
"metadata": {},
"outputs": [
{
@@ -279,7 +285,7 @@
"'My first class'"
]
},
"execution_count": 24,
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
@@ -350,7 +356,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
@@ -369,7 +375,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
@@ -379,7 +385,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 17,
"metadata": {},
"outputs": [
{
@@ -387,9 +393,9 @@
"evalue": "'FirstClass' object has no attribute 'name'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-23-4ab7dec1c737>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0meg1\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0meg1\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msymbol\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0meg2\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0meg2\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msymbol\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31m-----------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-17-4ab7dec1c737>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0meg1\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0meg1\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msymbol\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0meg2\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0meg2\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msymbol\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mAttributeError\u001b[0m: 'FirstClass' object has no attribute 'name'"
]
}
@@ -408,7 +414,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 18,
"metadata": {},
"outputs": [
{
@@ -426,6 +432,7 @@
" '__gt__',\n",
" '__hash__',\n",
" '__init__',\n",
" '__init_subclass__',\n",
" '__le__',\n",
" '__lt__',\n",
" '__module__',\n",
@@ -443,7 +450,7 @@
" 's']"
]
},
"execution_count": 24,
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
@@ -454,7 +461,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 19,
"metadata": {},
"outputs": [
{
@@ -486,7 +493,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 20,
"metadata": {},
"outputs": [],
"source": [
@@ -498,10 +505,8 @@
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"collapsed": true
},
"execution_count": 21,
"metadata": {},
"outputs": [],
"source": [
"eg1 = FirstClass('one',1)\n",
@@ -510,7 +515,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 22,
"metadata": {},
"outputs": [
{
@@ -536,7 +541,7 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 23,
"metadata": {},
"outputs": [],
"source": [
@@ -546,7 +551,7 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": 24,
"metadata": {},
"outputs": [
{
@@ -564,6 +569,7 @@
" '__gt__',\n",
" '__hash__',\n",
" '__init__',\n",
" '__init_subclass__',\n",
" '__le__',\n",
" '__lt__',\n",
" '__module__',\n",
@@ -582,7 +588,7 @@
" 's']"
]
},
"execution_count": 26,
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
@@ -606,7 +612,7 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 25,
"metadata": {},
"outputs": [],
"source": [
@@ -626,7 +632,7 @@
},
{
"cell_type": "code",
"execution_count": 28,
"execution_count": 26,
"metadata": {},
"outputs": [
{
@@ -646,7 +652,7 @@
},
{
"cell_type": "code",
"execution_count": 30,
"execution_count": 27,
"metadata": {},
"outputs": [
{
@@ -670,7 +676,7 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 30,
"metadata": {},
"outputs": [],
"source": [
@@ -688,7 +694,7 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": 31,
"metadata": {},
"outputs": [],
"source": [
@@ -697,7 +703,7 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 32,
"metadata": {},
"outputs": [
{
@@ -716,7 +722,7 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 33,
"metadata": {},
"outputs": [
{
@@ -725,7 +731,7 @@
"10"
]
},
"execution_count": 27,
"execution_count": 33,
"metadata": {},
"output_type": "execute_result"
}
@@ -743,19 +749,18 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 34,
"metadata": {},
"outputs": [
{
"ename": "AttributeError",
"evalue": "type object 'FirstClass' has no attribute 'multiply'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-5-448ee6ad2a26>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mFirstClass\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmultiply\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0meg4\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m: type object 'FirstClass' has no attribute 'multiply'"
]
"data": {
"text/plain": [
"10"
]
},
"execution_count": 34,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
@@ -785,7 +790,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 35,
"metadata": {},
"outputs": [],
"source": [
@@ -800,7 +805,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 36,
"metadata": {},
"outputs": [],
"source": [
@@ -809,7 +814,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 37,
"metadata": {},
"outputs": [
{
@@ -826,7 +831,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 38,
"metadata": {},
"outputs": [
{
@@ -861,7 +866,7 @@
" 'salary']"
]
},
"execution_count": 5,
"execution_count": 38,
"metadata": {},
"output_type": "execute_result"
}
@@ -879,7 +884,7 @@
},
{
"cell_type": "code",
"execution_count": 42,
"execution_count": 39,
"metadata": {},
"outputs": [],
"source": [
@@ -897,7 +902,7 @@
},
{
"cell_type": "code",
"execution_count": 43,
"execution_count": 40,
"metadata": {},
"outputs": [],
"source": [
@@ -906,7 +911,7 @@
},
{
"cell_type": "code",
"execution_count": 44,
"execution_count": 41,
"metadata": {},
"outputs": [
{
@@ -925,7 +930,7 @@
},
{
"cell_type": "code",
"execution_count": 45,
"execution_count": 42,
"metadata": {},
"outputs": [
{
@@ -943,6 +948,7 @@
" '__gt__',\n",
" '__hash__',\n",
" '__init__',\n",
" '__init_subclass__',\n",
" '__le__',\n",
" '__lt__',\n",
" '__module__',\n",
@@ -957,10 +963,10 @@
" '__subclasshook__',\n",
" '__weakref__',\n",
" 'artform',\n",
" 'money']"
" 'salary']"
]
},
"execution_count": 45,
"execution_count": 42,
"metadata": {},
"output_type": "execute_result"
}
@@ -978,7 +984,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 44,
"metadata": {},
"outputs": [],
"source": [
@@ -990,7 +996,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 45,
"metadata": {},
"outputs": [],
"source": [
@@ -999,7 +1005,7 @@
},
{
"cell_type": "code",
"execution_count": 48,
"execution_count": 46,
"metadata": {},
"outputs": [
{
@@ -1017,6 +1023,7 @@
" '__gt__',\n",
" '__hash__',\n",
" '__init__',\n",
" '__init_subclass__',\n",
" '__le__',\n",
" '__lt__',\n",
" '__module__',\n",
@@ -1034,7 +1041,7 @@
" 'salary']"
]
},
"execution_count": 48,
"execution_count": 46,
"metadata": {},
"output_type": "execute_result"
}
@@ -1045,7 +1052,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 47,
"metadata": {},
"outputs": [
{
@@ -1071,7 +1078,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 48,
"metadata": {},
"outputs": [],
"source": [
@@ -1087,7 +1094,7 @@
},
{
"cell_type": "code",
"execution_count": 51,
"execution_count": 49,
"metadata": {},
"outputs": [],
"source": [
@@ -1096,7 +1103,7 @@
},
{
"cell_type": "code",
"execution_count": 52,
"execution_count": 50,
"metadata": {},
"outputs": [
{
@@ -1123,7 +1130,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 51,
"metadata": {},
"outputs": [],
"source": [
@@ -1140,7 +1147,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 52,
"metadata": {},
"outputs": [],
"source": [
@@ -1149,7 +1156,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 53,
"metadata": {},
"outputs": [
{
@@ -1266,22 +1273,20 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"单独练习可以帮助你掌握python的窍门。给自己一个问题陈述并解决它们。您还可以在任何竞争的编码平台上提交问题求解。你编写的代码越多,你发现的越多,你就越开始欣赏这门语言。\n",
"找各个方面的练习题,并独立完成能帮助你掌握Python的窍门,例如给自己一个问题并解决它们,你还可以在任何编程竞赛平台上提交问题求解。你编写的代码越多,你发现的越多,你就越开始欣赏这门语言。强烈建议把[Python作业](https://gitee.com/pi-lab/machinelearning_homework/blob/master/homework_01_python/README.md)完成,并在[其他编程练习](https://gitee.com/pi-lab/machinelearning_homework/blob/master/homework_01_python/README.md#references)里面找一些练习题或者项目做一下。\n",
"\n",
"现在已经向您介绍了python,您可以尝试您感兴趣的领域中的不同python库。我强烈建议您查看这个Python框架、库和软件列表http://awesome-python.com\n",
"现在已经向你介绍了Python,您可以尝试您感兴趣的领域中的不同Python库。我强烈建议您查看这个Python框架、库和软件列表 http://awesome-python.com\n",
"\n",
"\n",
"python官方文档: https://docs.python.org/3/\n",
"\n",
"Pyton 教程:\n",
"* [Python tutorial (廖雪峰)](https://www.liaoxuefeng.com/wiki/1016959663602400)\n",
"* [Python基础教程](https://www.runoob.com/python/python-tutorial.html)\n",
"* [Python官方教程(中文版)](https://docs.python.org/zh-cn/3/tutorial/index.html)\n",
"\n",
"你也可以参考一些Python的练习程序,是由 Kartik Kannapur所写的。 Github Repo : https://github.com/rajathkumarmp/Python-Lectures \n",
"* Python官方文档: https://docs.python.org/3/\n",
"* 本教程来源于:https://github.com/rajathkumarmp/Python-Lectures \n",
"\n",
"\n",
"享受解决问题陈述,因为生命短暂,你需要python!"
"**最后,享受解决问题的快乐!因为生命短暂,你需要Python!**"
]
},
{


+ 172
- 176
1_numpy_matplotlib_scipy_sympy/1-numpy_tutorial.ipynb
File diff suppressed because it is too large
View File


+ 3
- 3
1_numpy_matplotlib_scipy_sympy/random-matrix.csv View File

@@ -1,3 +1,3 @@
0.73172 0.46544 0.72373
0.32391 0.09679 0.95467
0.36052 0.78361 0.00717
0.14040 0.96925 0.53435
0.77574 0.21287 0.68518
0.32863 0.70297 0.39513

BIN
1_numpy_matplotlib_scipy_sympy/random-matrix.npy View File


+ 4
- 4
README.md View File

@@ -69,11 +69,11 @@


## 2. 学习的建议
1. 为了更好的学习本课程,需要大家把Python编程能力培养好,通过一定数量的练习题、小项目培养Python编程思维,这样后续的机器学习理论与实践才能学的比较扎实
2. 每个课程前半部分是理论基础,后半部分是代码实现。如果想学的更扎实,可以自己把各个方法的代码亲自实现一下。做的过程尽可能自己想解决办法,因为最重要的目标不是代码本身,而是学会分析问题、解决问题的能力。
1. 为了更好的学习本课程,需要大家把Python编程能力培养好,通过一定数量的练习题、小项目培养Python编程思维,为后续的机器学习理论与实践打好坚实的基础
2. 每个课程前半部分是理论基础,后半部分是代码实现。如果想学的更扎实,可以自己把各个方法的代码亲自实现一下。做的过程如果遇到问题尽可能自己想解决办法,因为最重要的目标不是代码本身,而是学会分析问题、解决问题的能力。
3. **不能直接抄已有的程序,或者抄别人的程序**,如果自己不会要自己去想,去找解决方法,或者去问。如果直接抄别人的代码,这样的练习一点意义都没有。**如果感觉太难,可以做的慢一些,但是坚持自己思考、自己编写练习代码**。。
4. **请先遍历一遍所有的文件夹,了解有什么内容,资料**。各个目录里有很多说明文档,如果不会先找找有没有文档,如果找不到合适的文档就去网上找找。通过这个过程锻炼自己搜索文献、资料的能力。
5. 本课程的练习题最好使用[Linux](https://gitee.com/pi-lab/learn_programming/blob/master/6_tools/linux)以及Linux下的工具来做。逼迫自己使用[Linux](https://gitee.com/pi-lab/learn_programming/blob/master/6_tools/linux),只有多练、多用才能快速进步。如果实在太难,先在虚拟机里装一个Linux(例如Ubuntu,或者LinuxMint等),先熟悉一下。但是最终需要学会使用Linux。
5. 本课程的练习题最好使用[Linux](https://gitee.com/pi-lab/learn_programming/blob/master/6_tools/linux)以及Linux下的工具来做。逼迫自己使用[Linux](https://gitee.com/pi-lab/learn_programming/blob/master/6_tools/linux),只有多练、多用才能快速进步。如果实在太难,先在虚拟机(建议VirtualBox)里装一个Linux(例如Ubuntu,或者LinuxMint等),先熟悉一下。但是最终需要学会使用Linux。



@@ -103,7 +103,7 @@



## 4. 相关学习资料与参考
## 4. 更进一步学习

在上述内容学习完成之后,可以进行更进一步机器学习、计算机视觉方面的学习与研究,具体的资料可以参考:
1. 编程是机器学习研究、实现过程非常重要的能力,编程能力弱则无法快速试错,导致研究进度缓慢;如果编程能力强,则可以快速试错,快速编写实验代码等。强烈建议大家在学习本课程之后或之中,好好把数据结构、算法等基本功锻炼一下。具体的教程可以参考[《一步一步学编程》](https://gitee.com/pi-lab/learn_programming)


+ 3
- 3
tips/InstallPython.md View File

@@ -1,8 +1,8 @@
# Installing Python Environments
# 按照Python环境

由于Python的库比较多,并且依赖关系比较复杂,所以请仔细阅读下面的说明,使用下面的说明来安装能够减少问题的可能。*不过所列的安装方法,里面存在较多的细节,也许和你的系统并不适配,所以会遇到问题。如果遇到问题请通过搜索引擎去查找解决的办法*,通过这个方式锻炼自己解决问题的能力。
由于Python的库比较多,并且依赖关系比较复杂,所以请仔细阅读下面的说明,并按下面的说明来操作,减少问题出现的可能。 **但是所列的安装方法说明里有较多的细节,也许和你的系统并不适配,所以会遇到问题。如果遇到问题请通过搜索引擎去查找解决的办法**,通过这个方式锻炼自己解决问题的能力。

可以参考后面所列的`1.Winodws`或者`2.Linux`章节所列的将Python环境安装到计算机里。如果想一次性把所有的所需要的软件都安装到机器上,可以在本项目的根目录下执行下面的命令,需要Python 3.5版本,如果出现问题,则可以参考`requirements.txt`里面所列的软件包名字,手动一个一个安装。
可以参考后面所列的`1.Winodws`或者`2.Linux`章节所列的将Python环境安装到计算机里。如果想一次性把所有的所需要的软件都安装到机器上,可以在本项目的根目录下执行下面的命令,需要Python 3.5以上的版本,如果出现问题,则可以参考`requirements.txt`里面所列的软件包名字,手动一个一个安装。
```
pip install -r requirements.txt
```


Loading…
Cancel
Save