Skip to content

Commit ae6edb2

Browse files
committed
init ML with Python: From Coding To Deep Learning
0 parents  commit ae6edb2

File tree

8 files changed

+100
-0
lines changed

8 files changed

+100
-0
lines changed

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/FromCodingToDeepLearning.iml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

main.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# This is a Python Crash Course script.
2+
3+
# Press Shift+F10 to execute it or replace it with your code.
4+
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
5+
from math import sqrt
6+
7+
8+
def print_basic_arithmetic(result):
9+
# Use a breakpoint in the code line below to debug your script.
10+
print(f'Result: {result}') # Press Ctrl+F8 to toggle the breakpoint.
11+
12+
13+
def tuple_distance(tuple1, tuple2):
14+
return sqrt((tuple1[0] - tuple2[0]) ** 2 + (tuple1[1] - tuple2[1]) ** 2)
15+
16+
17+
# Press the green button in the gutter to run the script.
18+
if __name__ == '__main__':
19+
# Basic Arithmetic:
20+
print_basic_arithmetic(((4 - 2) + 4) / 5 * 9)
21+
# Variable Assignment:
22+
x = (1, 0)
23+
y = (5, 3)
24+
print(f'Distance between {x} & {y} is {tuple_distance(x, y)}')
25+
# Strings
26+
s1 = '\tShe love you'
27+
s2 = '\nyeah \n\tyeah \n\t\tyeah'
28+
print(s1 + s2)
29+
my_age = 31
30+
print('My age is: {}'.format(my_age - 2))
31+
# Lists
32+
aList = [5, 6, 7, 8, 9, True, 'a lot of different type of things']
33+
print(aList)
34+
otherList = [1, 2, 3, 4] + aList
35+
print(otherList)
36+
print('The last item in otherList list is with "-1th" element: ', otherList[- 1])
37+
print('The last item in otherList list is with len() function: ', otherList[len(otherList) - 1])
38+
print(otherList[0:4])
39+
otherList[9] = False
40+
print(otherList)
41+
otherList.remove(1)
42+
print(otherList)
43+
otherList.append(True)
44+
print(otherList)
45+
# Sets operations: Union - Intersection - Difference
46+
A = {'Dog', 'Cat', 'Pig', 'Chicken', 'Rabbit', 'Turtle'}
47+
B = {'Dog', 'Chicken', 'Monkey', 'Cow'}
48+
U = A.union(B)
49+
print('The union of set A & set B is: ', U)
50+
N = A.intersection(B)
51+
print('The intersection of set A & set B is: ', N)
52+
D = A.difference(B)
53+
print('The difference of set A & set B is ', D)
54+
55+
# See PyCharm help at https://www.jetbrains.com/help/pycharm/

0 commit comments

Comments
 (0)