3 Symbols in Data Science (part 1) (Math & Python) Flashcards
1 Name, use and example of =
Equality
5 = 2+3
5 is equal to 2+3
2 Name, use example and equivalent in Python of ≠
Inequality
5 ≠ 4
5 is not equal to 4
In Python:
!= 3!=4
2.1 Outcome of:
print(5!=4)
True
3 Name, use and example of ≈
approximation
x ≈ y
x is approximately equal to y
4 What does the /= operator mean in Python?
It’s an assignment operator shorthand for / and =
x /= 3 # equivalent to x = x / 3
4.1 Outcome of:
x = 1
x/=4
x
0.25
5 Name, use and example of >
greater than
5 > 4
5 is greater than 4
5.1 Outcome of:
5>4
True
6 Name, how to read and example of
less than
4 < 5
4 is less than 5
6.1 Outcome of:
5<4
False
7 Name, how to read, example, and equivalent in Python of≥
greater than or equal to
5 ≥ 4,
x ≥ y means x is greater than or equal to y
Python: 5>=4
Outcome of:
a =[0,0]
b=[0,1]
a>=b
False
8 Name, how to read, example, and equivalent in Python of ≤
less than or equal to
4 ≤ 5,
x ≤ y x is less than or equal to y
Python: 4<=4
8.1 Outcome of:
a =[0,0]
b=[0,1]
a<=b
9 Name, use in Maths and Python and examples of: ( )
Parentheses
Maths:order of operation. calculate expression inside first
Python: order of operation, tuples, generator expressions, function calls and other syntax
2 × (3+5) = 16
a=(1,4,5) #tuple (unchangeable)
9.1 Outcome of:
print(2* (3+5) )
print(2*3+5)
16
11
10 Name, use in Maths and Python and examples of:[ ]
Brackets
Maths: order of operations.calculates expression inside first
Python: order of operation, to define mutable data types - lists, list comprehensions and for indexing/lookup/slicing
10.1 Outcome of:
print[2* [3+5] ]
TypeError: ‘builtin_function_or_method’ object is not subscriptable
11 Name and read: +
1 + 1 = 2
Addition
One plus one equals two
1 + 1 = 2
12 Name and read: −
Subtraction
2 − 1 = 1
Two minus one equals one
13 Name and example of: ±
plus and minus
3 ± 5 = 8 or -2
14 Name and example of: ±
±
minus - plus
both minus and plus operations
3 ∓ 5 = -2 or 8
15 Name,use,read and Python uses of *
2 * 3 = 6
Asterisk
Multiplication
2 * 3 = 6
Two multiplied by three is equal to six
Python: Multiplication and unpacking
16 Name,use of ⋅
Multiplication dot
2 ⋅ 3 = 6