Skip to content

Commit

Permalink
little aesthetics
Browse files Browse the repository at this point in the history
  • Loading branch information
PhysicsOfData committed Oct 18, 2021
1 parent 8d55801 commit e7111a8
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions 01_Fundamentals.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
" A module is a file which contains python functions, global variables etc. It is nothing but .py file which has python executable code / statement.\n",
"\n",
" * Packages:\n",
" A package is namespace which contains multiple package/modules. It is a directory which contains a special file `__init__.py`\n",
" A package is a namespace which contains multiple package/modules. It is a directory which contains a special file `__init__.py`\n",
" \n",
" * Libraries:\n",
" A library is a collection of various packages. There is no difference between package and python library conceptually.\n",
Expand Down Expand Up @@ -251,7 +251,10 @@
"print (x)\n",
"\n",
"# Note the difference w.r.t python 2. In python 3 map retuns an iterator so you can do stuff like:\n",
"for i in map(square,range(5)): print(i)"
"for i in map(square,range(5)): print(i)\n",
"\n",
"# or\n",
"[i for i in map(square,range(6))]"
]
},
{
Expand All @@ -260,7 +263,7 @@
"source": [
"### filter\n",
"\n",
"The filter function applies a predicate to each memmber of a collection, retaining only those members where the predicate is True"
"The filter function applies a predicate to each member of a collection, retaining only those members where the predicate is True"
]
},
{
Expand All @@ -275,13 +278,20 @@
"print (list(filter(is_even, range(5))))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Combinations in sequence of HOF are obviously possible"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"list(map(square, filter(is_even, range(5))))\n"
"list(map(square, filter(is_even, range(5))))"
]
},
{
Expand Down

0 comments on commit e7111a8

Please sign in to comment.