-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updates for computationally calculated dependencies
- Loading branch information
Showing
9 changed files
with
795 additions
and
793 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ __pycache__ | |
.mypy_cache | ||
.venv | ||
.vscode | ||
env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "f70a0f3e", | ||
"metadata": {}, | ||
"source": [ | ||
"# 002: Basic Control Structures" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "aec9a83f", | ||
"metadata": {}, | ||
"source": [ | ||
"## Zipping Up" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"id": "b5663e8e", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Set my_dictionary[ a ] to be 23\n", | ||
"Set my_dictionary[ b ] to be 42\n", | ||
"Set my_dictionary[ c ] to be 12\n", | ||
"Set my_dictionary[ d ] to be 9\n", | ||
"Set my_dictionary[ e ] to be 5\n", | ||
"Set my_dictionary[ f ] to be 1\n", | ||
"{'a': 23, 'b': 42, 'c': 12, 'd': 9, 'e': 5, 'f': 1}\n", | ||
"Set my_dictionary[ 23 ] to be a\n", | ||
"Set my_dictionary[ 42 ] to be b\n", | ||
"Set my_dictionary[ 12 ] to be c\n", | ||
"Set my_dictionary[ 9 ] to be d\n", | ||
"Set my_dictionary[ 5 ] to be e\n", | ||
"Set my_dictionary[ 1 ] to be f\n", | ||
"{23: 'a', 42: 'b', 12: 'c', 9: 'd', 5: 'e', 1: 'f'}\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"# Loop through them to make a dictionary, where the first list is the keys,\n", | ||
"# and the second list is the values.\n", | ||
"# You might want to make this into a function where the first argument is\n", | ||
"# the first list, and the second argument is the second list\n", | ||
"def zip_two_lists(key_list, value_list):\n", | ||
" my_dictionary = {}\n", | ||
" for i in range(len(key_list)):\n", | ||
" my_key = key_list[i]\n", | ||
" my_value = value_list[i]\n", | ||
"\n", | ||
" print('Set my_dictionary[', my_key, '] to be ', my_value)\n", | ||
" my_dictionary[my_key] = my_value\n", | ||
" return my_dictionary\n", | ||
"\n", | ||
"# Print out your new dictionary\n", | ||
"my_list_of_keys = ['a', 'b', 'c', 'd', 'e', 'f']\n", | ||
"my_list_of_values = [23, 42, 12, 9, 5, 1]\n", | ||
"my_new_dictionary = zip_two_lists(my_list_of_keys, my_list_of_values)\n", | ||
"print(my_new_dictionary)\n", | ||
"my_new_dictionary = zip_two_lists(my_list_of_values, my_list_of_keys)\n", | ||
"print(my_new_dictionary)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"id": "e131b7ca", | ||
"metadata": { | ||
"collapsed": true | ||
}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"{'a': 23, 'b': 42, 'c': 12, 'd': 9, 'e': 5, 'f': 1}" | ||
] | ||
}, | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"new_dct = {}\n", | ||
"for key, value in zip(my_list_of_keys, my_list_of_values):\n", | ||
" new_dct[key] = value\n", | ||
"new_dct" | ||
] | ||
} | ||
], | ||
"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.7.11" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.