Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
db889ab
Added Notes for weeks one and two
MichaelPerlmutter Dec 22, 2020
657518b
Added Content On OOP
MichaelPerlmutter Dec 23, 2020
6500a39
Deleted error in container lecture
MichaelPerlmutter Dec 23, 2020
a8a3569
Added More content
MichaelPerlmutter Dec 24, 2020
3909afd
Added material
MichaelPerlmutter Dec 25, 2020
a6b9e92
Added Material
MichaelPerlmutter Dec 25, 2020
49e115e
Added More Content
MichaelPerlmutter Dec 25, 2020
e980785
Added Content
MichaelPerlmutter Dec 26, 2020
1ff9691
Added Content
MichaelPerlmutter Dec 27, 2020
0718a63
Update Generators.ipynb
MichaelPerlmutter Dec 27, 2020
6346007
Added Content
MichaelPerlmutter Dec 30, 2020
5335c33
Update palmer_penguins_subset.csv
MichaelPerlmutter Dec 30, 2020
5546477
Added Content
MichaelPerlmutter Jan 2, 2021
6504410
Added Content
MichaelPerlmutter Jan 3, 2021
ce1c7b3
Added Content
MichaelPerlmutter Jan 4, 2021
97772ba
editted intro slides
MichaelPerlmutter Jan 4, 2021
e7e67a8
added content
MichaelPerlmutter Jan 4, 2021
618bde7
updated stuff
MichaelPerlmutter Jan 6, 2021
32f2dda
Merge branch 'master' into Mikes_Branch
MichaelPerlmutter Jan 6, 2021
f6686b7
Added code from live lecture 01016
MichaelPerlmutter Jan 6, 2021
858992a
Added Content
MichaelPerlmutter Jan 9, 2021
f06ed9e
AddedConent
MichaelPerlmutter Jan 10, 2021
80f97a6
Added Content
MichaelPerlmutter Jan 11, 2021
a5cd27e
Update Hello_and_Numbers.ipynb
MichaelPerlmutter Jan 11, 2021
6b91a73
Added content
MichaelPerlmutter Jan 12, 2021
ec9e93a
Added Content
MichaelPerlmutter Jan 16, 2021
a237dd6
Merge branch 'master' into Mikes_Branch
MichaelPerlmutter Jan 16, 2021
bfea00c
Added content
MichaelPerlmutter Jan 20, 2021
f227975
Added Contentt
MichaelPerlmutter Jan 22, 2021
86ae8b3
Merge branch 'master' into Mikes_Branch
MichaelPerlmutter Jan 24, 2021
e62d34e
Added Content
MichaelPerlmutter Jan 28, 2021
37decbd
Merge branch 'master' into Mikes_Branch
MichaelPerlmutter Jan 28, 2021
9a0ba40
Merge branch 'master' into Mikes_Branch
MichaelPerlmutter Jan 29, 2021
3a6f37f
AddedContent ModifiedHW4
MichaelPerlmutter Jan 30, 2021
e38fd57
Added Stuff
MichaelPerlmutter Feb 1, 2021
b30808b
added content
MichaelPerlmutter Feb 5, 2021
4d17ea7
Added content
MichaelPerlmutter Feb 9, 2021
f42d8e9
updated material
MichaelPerlmutter Feb 10, 2021
2b20e82
Merge branch 'master' into Mikes_Branch
MichaelPerlmutter Feb 10, 2021
4ef15ba
added content
MichaelPerlmutter Feb 11, 2021
abc9a7e
Merge branch 'master' into Mikes_Branch
MichaelPerlmutter Feb 11, 2021
7d07887
added content
MichaelPerlmutter Feb 14, 2021
4306d7f
Added Content
MichaelPerlmutter Feb 20, 2021
0e2e7b2
Merge branch 'master' into Mikes_Branch
MichaelPerlmutter Feb 20, 2021
7255ea5
added_content
MichaelPerlmutter Feb 23, 2021
2d63409
addedcontent
MichaelPerlmutter Feb 23, 2021
875b53f
Merge branch 'master' into Mikes_Branch
MichaelPerlmutter Feb 23, 2021
51c91d5
Added Content
MichaelPerlmutter Mar 5, 2021
ac89686
Added copy video
MichaelPerlmutter Mar 31, 2021
b6a4f72
Wrote Compartment Lecture
MichaelPerlmutter Apr 3, 2021
0ff5f86
Added InstanceVideo
MichaelPerlmutter Apr 6, 2021
edb41b8
Gave Lecture
MichaelPerlmutter Apr 12, 2021
f2eb04a
Merge branch 'master' into Mikes_Branch
MichaelPerlmutter Apr 12, 2021
b739fe8
Added Content
MichaelPerlmutter Apr 25, 2021
afad523
Merge branch 'master' into Mikes_Branch
MichaelPerlmutter Apr 25, 2021
c27e2bd
Added Content
MichaelPerlmutter Apr 27, 2021
4e37247
Added
MichaelPerlmutter May 13, 2021
24fb5de
Merge branch 'master' into Mikes_Branch
MichaelPerlmutter May 13, 2021
86d7052
Added Content
MichaelPerlmutter Jun 23, 2021
7936bb9
Added content
MichaelPerlmutter Jun 29, 2021
a827a03
Edited HW2
MichaelPerlmutter Jul 2, 2021
13b1bdd
added content
MichaelPerlmutter Aug 2, 2021
7a5df87
did stuff
MichaelPerlmutter Sep 16, 2021
7a69f26
added content
MichaelPerlmutter Oct 10, 2021
bdabac5
Added content
MichaelPerlmutter Nov 21, 2021
8c63a2f
Added content
MichaelPerlmutter Dec 12, 2021
ba56e61
added content
MichaelPerlmutter Jan 10, 2022
52d1efd
did stuff
MichaelPerlmutter Feb 3, 2022
68d9e7c
Added stuff
MichaelPerlmutter Feb 27, 2022
5482d69
Addedstuff
MichaelPerlmutter Feb 28, 2022
b96f4a5
Added stuff
MichaelPerlmutter Jun 25, 2022
18504bc
did stuff
MichaelPerlmutter Oct 19, 2022
abecd90
Create HW3 - Copy.ipynb
MichaelPerlmutter Nov 21, 2022
54ae2f4
Did stuff
MichaelPerlmutter Nov 21, 2022
26ea612
did stuff
MichaelPerlmutter Nov 21, 2022
f2a9246
Update Alg_bias_with_penguins_Blank.ipynb
MichaelPerlmutter Mar 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file added Calendar_Summer2021.xlsx
Binary file not shown.
3 changes: 3 additions & 0 deletions Content_Mike/.jovianrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"notebooks": {}
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def describe_1():
print("funs_1.py is the best .py file ever!")
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def describe_2():
print("With all due respect, I disagree.")
print("funs_1.py is a very good file, but funs_2.py is the best ever")
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 23 14:20:23 2020

@author: micha
"""

#function definitions

def say_hello():

print("Hello everybody! How are you doing today?")



#imperative commands

say_hello()
3 changes: 3 additions & 0 deletions Content_Mike/Auxillary_py_files/example_module/top_level.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def describe():
print("The file top_level.py has been imported from our example module")
print("We are executing the fuction describe.")
1 change: 1 addition & 0 deletions Content_Mike/Auxillary_py_files/hello.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print("Hello, I am being imported")
18 changes: 18 additions & 0 deletions Content_Mike/Auxillary_py_files/my_script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 23 14:20:23 2020

@author: micha
"""

#function definitions

def say_hello():

print("Hello everybody! How are you doing today?")



#imperative commands

say_hello()
20 changes: 20 additions & 0 deletions Content_Mike/Auxillary_py_files/my_script2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 23 14:20:23 2020

@author: micha
"""

#function definitions

def say_hello():

print("Hello everybody! How are you doing today?")



#imperative commands


if __name__== "__main__":
say_hello()
50 changes: 50 additions & 0 deletions Content_Mike/Auxillary_py_files/unit_test_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import unittest

def reverse_lookup(D, val):
"""
Find all keys in a dictionary D with the specified value.
"""
if type(D) != dict:
raise TypeError("First argument must be a dictionary")

return [key for key in D.keys() if D[key] == val]

class TestReverseLookup(unittest.TestCase):

def test_type_error(self):
D = ["cat", "dog", "giraffe"]
with self.assertRaises(TypeError):
reverse_lookup(D, "Picard")

def test_standard_lookup(self):

D={
"cat":3,
"dog":3,
"platypus":8,
"cow":3,
"duck":4
}

result = len(reverse_lookup(D, 3))

self.assertEqual(result, 3)

def test_no_matches(self):
# this test is expected to fail

D={
"cat":3,
"dog":3,
"platypus":8,
"cow":3,
"duck":4
}

result = len(reverse_lookup(D, 6))

self.assertEqual(result, 0)


if __name__ == "__main__":
unittest.main()
138 changes: 138 additions & 0 deletions Content_Mike/Basics/AnswerII/Copy.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In the ``how memory works\" video, you saw that lists work the following way"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[2, 1]\n",
"[2, 1]\n"
]
}
],
"source": [
"L1=[2]\n",
"L2=L1\n",
"L1+=[1]\n",
"print(L1) \n",
"print(L2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"By Contrast for ints:"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"3\n",
"2\n"
]
}
],
"source": [
"X=2\n",
"Y=X\n",
"X+=1\n",
"print(X)\n",
"print(Y)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This is because lists are **mutable objects** whereas ints are **immutable objects**.\n",
"\n",
"Common mutable objects include: lists, sets, and dicts\n",
"\n",
"Common immutable objects include: bools, ints, strings, and tuples\n",
"\n",
"[More on immutable vs mutable objects is available here](https://www.geeksforgeeks.org/mutable-vs-immutable-objects-in-python/)\n",
"\n",
"### What if I want to change L2 without changing L1?\n",
"\n",
"The solution is simple. Use L1.copy()"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[2, 1]\n",
"[2]\n"
]
}
],
"source": [
"L1=[2]\n",
"L2=L1.copy() #this is the only line that is different\n",
"L1+=[1]\n",
"print(L1)\n",
"print(L2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Big take away\n",
"\n",
"Whenever you are setting, e.g. a list equal to another list. Think to yourself,``If I change one list, do I want to change both of them?\" If the answer is no, use copy."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"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.8.8"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Loading