Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
6626616
[ADD] .gitignore
mvaraujo Mar 14, 2020
f11f43b
[ADD] 001-Dicts-Sets-Tuples
mvaraujo Mar 14, 2020
c18382d
[ADD] 002-String-Operations
mvaraujo Mar 14, 2020
5780907
[ADD] 003-List-Comprehension
mvaraujo Mar 14, 2020
8152015
[ADD] 004-Python-Functions
mvaraujo Mar 14, 2020
44d4399
[ADD] 005-Error-Handling
mvaraujo Mar 14, 2020
5e63e41
[ADD] 006-Numpy
mvaraujo Mar 14, 2020
999d73f
[ADD] 007-Intro-Pandas
mvaraujo Mar 14, 2020
882d64c
[ADD] 008-Importing-Exporting-Data
mvaraujo Mar 14, 2020
1c0c10e
[ADD] 009-Data-Manipulation
mvaraujo Mar 14, 2020
e637698
[ADD] 013-Lambda-Functions
mvaraujo Mar 14, 2020
12000ae
[ADD] 014-Advanced-Regex
mvaraujo Mar 14, 2020
57844e1
[UPD] Renomeando para 022-Parallelization
mvaraujo Mar 27, 2020
12c0d3d
Merge branch 'master' into mvaraujo
mvaraujo Mar 27, 2020
19b03b0
[UPD] Atualizando sabe-se o que no lab 009
mvaraujo Apr 4, 2020
9c22f8a
Merge remote-tracking branch 'andre/master'
mvaraujo Apr 4, 2020
c06fe0c
Merge branch 'master' into mvaraujo
mvaraujo Apr 4, 2020
a5cc4f2
Merge remote-tracking branch 'andre/master'
mvaraujo Apr 18, 2020
a5e85e6
Merge branch 'master' into mvaraujo
mvaraujo Apr 18, 2020
8894fda
Merge remote-tracking branch 'andre/master'
mvaraujo Apr 22, 2020
cc02369
Merge branch 'master' into mvaraujo
mvaraujo Apr 22, 2020
2372e5e
Merge remote-tracking branch 'andre/master'
mvaraujo May 2, 2020
9c467ec
Merge branch 'master' into mvaraujo
mvaraujo May 2, 2020
a498001
[ADD] 010-Data-Cleaning/your-code/data-cleaning-lab.ipynb
mvaraujo May 2, 2020
6736498
[ADD] 011-Dataframe-Calculations/your-code/challenge-1.ipynb
mvaraujo May 2, 2020
2feca6e
Merge remote-tracking branch 'andre/master'
mvaraujo May 10, 2020
2096c30
Merge branch 'master' into mvaraujo
mvaraujo May 10, 2020
b072b7c
[ADD] Partial - 011-Dataframe-Calculations/your-code/challenge-2.ipynb
mvaraujo May 14, 2020
8cacf69
Merge remote-tracking branch 'andre/master'
mvaraujo May 14, 2020
89f71c7
Merge remote-tracking branch 'origin/master' into mvaraujo
mvaraujo May 14, 2020
15e5474
Merge remote-tracking branch 'andre/master'
mvaraujo May 30, 2020
0a2f497
Merge branch 'master' into mvaraujo
mvaraujo May 30, 2020
3bcb5e0
[ADD] 000-Project_LinearRegression
mvaraujo May 31, 2020
23dea7b
[UPD] 000-Project_LinearRegression
mvaraujo Jun 6, 2020
ceae468
Merge remote-tracking branch 'andre/master'
mvaraujo Jun 6, 2020
453285e
Merge branch 'master' into mvaraujo
mvaraujo Jun 6, 2020
c84b954
Merge remote-tracking branch 'andre/master'
mvaraujo Jun 11, 2020
d193c43
Merge branch 'master' into mvaraujo
mvaraujo Jun 11, 2020
a51d1c1
Merge remote-tracking branch 'andre/master'
mvaraujo Jun 16, 2020
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.ipynb_checkpoints
54 changes: 40 additions & 14 deletions module-1/labs/001-Dicts-Sets-Tuples/your-code/challenge-1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"metadata": {},
"outputs": [],
"source": [
"# Your code here\n"
"tup = ('I',)"
]
},
{
Expand All @@ -37,7 +37,7 @@
"metadata": {},
"outputs": [],
"source": [
"# Your code here\n"
"print(type(tup))"
]
},
{
Expand All @@ -59,9 +59,9 @@
"metadata": {},
"outputs": [],
"source": [
"# Your code here\n",
"tup.append('I')\n",
"\n",
"# Your explanation here\n"
"# Tuples are immutable, so, they do not have an append method"
]
},
{
Expand All @@ -83,9 +83,9 @@
"metadata": {},
"outputs": [],
"source": [
"# Your code here\n",
"tup = ('I', 'r', 'o', 'n', 'h', 'a', 'c', 'k')\n",
"\n",
"# Your explanation here\n"
"# we are creating a brand new tuple and assigning it to the tup variable"
]
},
{
Expand All @@ -107,7 +107,11 @@
"metadata": {},
"outputs": [],
"source": [
"# Your code here\n"
"tup1 = tup[0:4]\n",
"tup2 = tup[4:8]\n",
"\n",
"print(tup1)\n",
"print(tup2)"
]
},
{
Expand All @@ -125,7 +129,10 @@
"metadata": {},
"outputs": [],
"source": [
"# Your code here\n"
"tup3 = tup1 + tup2\n",
"\n",
"print(tup3)\n",
"print(tup3 == tup)"
]
},
{
Expand All @@ -141,7 +148,10 @@
"metadata": {},
"outputs": [],
"source": [
"# Your code here\n"
"count = len(tup1) + len(tup2)\n",
"\n",
"print(count)\n",
"print(count == len(tup3))"
]
},
{
Expand All @@ -157,7 +167,14 @@
"metadata": {},
"outputs": [],
"source": [
"# Your code here\n"
"indexOfH = 0\n",
"\n",
"for i in range(0, len(tup3)):\n",
" if tup3[i] == 'h':\n",
" indexOfH = i\n",
" break\n",
" \n",
"print(indexOfH)"
]
},
{
Expand All @@ -181,7 +198,10 @@
"metadata": {},
"outputs": [],
"source": [
"# Your code here\n"
"letters = [\"a\", \"b\", \"c\", \"d\", \"e\"]\n",
"\n",
"for letter in letters:\n",
" print(letter in tup3)"
]
},
{
Expand All @@ -199,7 +219,13 @@
"metadata": {},
"outputs": [],
"source": [
"# Your code here\n"
"cntOccurOf = 0\n",
"\n",
"for letter in letters:\n",
" if(letter in tup3):\n",
" cntOccurOf += 1\n",
" \n",
"print (cntOccurOf)"
]
}
],
Expand All @@ -219,9 +245,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.2"
"version": "3.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
82 changes: 65 additions & 17 deletions module-1/labs/001-Dicts-Sets-Tuples/your-code/challenge-2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"metadata": {},
"outputs": [],
"source": [
"# Your code here\n"
"sample_list_1 = random.sample(range(100), 80)"
]
},
{
Expand All @@ -58,7 +58,9 @@
"metadata": {},
"outputs": [],
"source": [
"# Your code here\n"
"set1 = set(sample_list_1)\n",
"\n",
"print(len(set1) == len(sample_list_1))"
]
},
{
Expand All @@ -81,7 +83,12 @@
"metadata": {},
"outputs": [],
"source": [
"# Your code here\n"
"sample_list_2 = []\n",
"\n",
"for i in range(0, 80):\n",
" sample_list_2.append(random.randrange(0, 100))\n",
" \n",
"print(sample_list_2)"
]
},
{
Expand All @@ -97,7 +104,9 @@
"metadata": {},
"outputs": [],
"source": [
"# Your code here\n"
"set2 = set(sample_list_2)\n",
"\n",
"print(len(set2) == len(sample_list_2))"
]
},
{
Expand All @@ -113,7 +122,9 @@
"metadata": {},
"outputs": [],
"source": [
"# Your code here\n"
"set3 = set1 - set2\n",
"\n",
"print(set3)"
]
},
{
Expand All @@ -129,7 +140,9 @@
"metadata": {},
"outputs": [],
"source": [
"# Your code here\n"
"set4 = set2 - set1\n",
"\n",
"print(set4)"
]
},
{
Expand All @@ -145,7 +158,9 @@
"metadata": {},
"outputs": [],
"source": [
"# Your code here\n"
"set5 = set1.intersection(set2)\n",
"\n",
"print(set5)"
]
},
{
Expand All @@ -169,7 +184,21 @@
"metadata": {},
"outputs": [],
"source": [
"# Your code here\n"
"# Your code here\n",
"# len(set3) = len(set1) - Len(set5)\n",
"# len(set4) = len(set2) - Len(set5)\n",
"# len(set5) = len(set1) + len(set2) - len(set3) - len(set4)\n",
"\n",
"\n",
"print('set1', len(set1))\n",
"print('set2', len(set2))\n",
"print('set3', len(set3))\n",
"print('set4', len(set4))\n",
"print('set5', len(set5))\n",
"\n",
"print(len(set3), len(set1) - len(set5))\n",
"print(len(set4), len(set2) - len(set5))\n",
"print(len(set5), len(set1) + len(set2) - len(set3) - len(set4))"
]
},
{
Expand All @@ -185,7 +214,9 @@
"metadata": {},
"outputs": [],
"source": [
"# Your code here\n"
"set6 = set()\n",
"\n",
"print(set6)"
]
},
{
Expand All @@ -201,7 +232,10 @@
"metadata": {},
"outputs": [],
"source": [
"# Your code here\n"
"set6.update(set3)\n",
"set6.update(set5)\n",
"\n",
"print(set6)"
]
},
{
Expand All @@ -217,7 +251,7 @@
"metadata": {},
"outputs": [],
"source": [
"# Your code here\n"
"print(set1 == set6)"
]
},
{
Expand All @@ -233,7 +267,8 @@
"metadata": {},
"outputs": [],
"source": [
"# Your code here\n"
"print(set2.issubset(set1))\n",
"print(set3.issubset(set1))"
]
},
{
Expand All @@ -251,7 +286,10 @@
"metadata": {},
"outputs": [],
"source": [
"# Your code here\n"
"agg345 = set3.union(set4, set5)\n",
"agg12 = set1.union(set2)\n",
"\n",
"print(agg345 == agg12)"
]
},
{
Expand All @@ -267,7 +305,9 @@
"metadata": {},
"outputs": [],
"source": [
"# Your code here\n"
"# There is no definition of 'first element' to sets - an arbitrary element will be poped\n",
"\n",
"set1.pop()"
]
},
{
Expand All @@ -287,7 +327,15 @@
"metadata": {},
"outputs": [],
"source": [
"# Your code here\n"
"list_to_remove = [1, 9, 11, 19, 21, 29, 31, 39, 41, 49, 51, 59, 61, 69, 71, 79, 81, 89, 91, 99]\n",
"\n",
"print('Before', set1)\n",
"\n",
"for item_to_remove in list_to_remove:\n",
" if(item_to_remove in set1):\n",
" set1.remove(item_to_remove)\n",
" \n",
"print('After', set1)"
]
}
],
Expand All @@ -307,9 +355,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.2"
"version": "3.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
23 changes: 19 additions & 4 deletions module-1/labs/001-Dicts-Sets-Tuples/your-code/challenge-3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,15 @@
"metadata": {},
"outputs": [],
"source": [
"# Your code here\n"
"word_freq2 = {}\n",
"\n",
"word_freq_sorted_keys = list(word_freq.keys())\n",
"word_freq_sorted_keys.sort()\n",
"\n",
"for key in word_freq_sorted_keys:\n",
" word_freq2[key] = word_freq[key]\n",
" \n",
"print(word_freq2)"
]
},
{
Expand Down Expand Up @@ -94,7 +102,14 @@
"metadata": {},
"outputs": [],
"source": [
"# Your code here\n"
"import operator\n",
"\n",
"word_freq2 = {}\n",
"\n",
"for key, value in sorted(word_freq.items(), key=operator.itemgetter(1)):\n",
" word_freq2[key] = value\n",
" \n",
"print(word_freq2)"
]
}
],
Expand All @@ -114,9 +129,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.2"
"version": "3.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
Loading