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
17 Name,use,read of:÷
6 ÷ 2 = 3
Division sign
Six divided by 2 equals three
18 Name and use in Maths and Python of /
Slash
Maths: Division
Python: Division, for file paths
6 / 2 = 3
p = PurePath(‘/etc’)
18 Name and use of —
horizontal line
division / fraction
19 Name and use of % in Maths and Python
Maths: Percentage
Python:Modulo
Python: remainder calculation
Python: 7%2 = 1
Maths: 1% = 1/100
10% × 30 = 3
20 Name and use of .
Period, decimal point, decimal separator
2.56 = 2+56/100
21 Name and use of a^b
Power Exponent
2^3 = 8
22 Name and use of a^b
Caret
Exponent
2 ^ 3 = 8
22 Name and use of √a
square root
√a ⋅ √a = a
√9 = ±3
22 Name and use of 3√a
cube root
3√a ⋅ 3√a ⋅ 3√a = a
3√8 = 2
23 Name and use of n√a
n-th root (radical)
for n=3, n√8 = 2
23.1 Calculate for n=7, n√8 = 2
#Answer: n = 7 8**(1/n)
24 Name and use of ‰
Per-mille
1‰ = 1/1000 = 0.1%
10‰ × 30 = 0.3