1. Introduction Flashcards

1
Q

FLOAT

A

kommagetal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

STR

A

tekst

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

BOOL

A

logische waarde, “juist” of “fout”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

upper()

A

Hoofdletters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

INT

A

geheel getal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

replace(x, y)

A

X met Y vervangen

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

==

A

Om gelijkheid te meten, je krijgt als antwoord juist of fout

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

!=

A

Om ongelijkheid te meten, je krijgt als antwoord juist of fout

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

and

A

Beide uitkomsten moeten juist zijn

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

or

A

Een van de uitkomsten moet juist zijn

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

in

A

Of getal in list of string of array staat

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

not

A

Uitkomst is juist als het fout is

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

not in

A

Of getal niet in list of string of array staat

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

print(mijn_lijst[2:])

A

Waarde 2 tot einde van mijn lijst

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

print(mijn_lijst[:3])

A

Van begin tot waarde 3 van mijn lijst

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

mijn_lijst.remove(30)

A

Verwijder 30 uit de lijst

17
Q

mijn_lijst.append(60)

A

Voeg 60 toe aan het einde van de lijst

18
Q

print(len(mijn_lijst))

A

Geef weer hoeveel items mijn lijst bevat

19
Q

mijn_lijst.insert(2, 25)

A

Voeg item 25 toe als 3e getal (index begint bij 0)

20
Q

Wat is de output: print(mijn_lijst[1:4]

Met als waarde: mijn_lijst = [10, 20, 30, 40, 50]

A

Output: [20, 30, 40]

21
Q

Wat is de output: print(mijn_lijst[-4:-1])

Met als waarde: mijn_lijst = [10, 20, 30, 40, 50]

A

Output: [20, 30, 40]

22
Q

Wat is de output: print(mijn_lijst[0:5:2]

Met als waarde: mijn_lijst = [10, 20, 30, 40, 50]

A

Spring elke 2 items

Output: [10, 30, 50]

23
Q

Wat is de output: print(mijn_lijst[::-1])

Met als waarde: mijn_lijst = [10, 20, 30, 40, 50]

A

Lijst omdraaien

Output: [50, 40, 30, 20, 10]

24
Q

array.shape

A

Je geeft de vorm van de array weer

BV: Output: (2, 3) (2 rijen, 3 kolommen)

25
Q

np.zeros((2, 3))

A

[[0. 0. 0.]

Maakt een array gevuld met nullen

Output:
# [[0. 0. 0.]
# [0. 0. 0.]]

26
Q

np.ones((3, 2))

A

[[0. 0. 0.]

Maakt een array gevuld met enen

Output:
# [[1. 1.]
# [1. 1.]
# [1. 1.]]

27
Q

np.random.rand()

A

Maakt een array gevuld met willekeurige getallen (tussen 0 en 1)

Willekeurige waarden

28
Q

print(a @ b)

A

Matrixvermenigvuldiging a en b

29
Q

print(a.T)

A

Matrix a transponeren

30
Q

print(arr[1, 2])

A

Specifieke elementen uit een array ophalen

Output: 6 (tweede rij, derde kolom)

31
Q

print(arr[:, 1])

A

Meerdere elementen tegelijk selecteren met :

Output: [2 5] (tweede kolom van beide rijen)

32
Q

print(arr[0:2, 1])

A

Output: [2 5] (tweede kolom van de eerste twee rijen)

33
Q

print(np.mean(arr, axis=0))

A

axis=0: Werkt kolom per kolom (over de rijen)

34
Q

print(np.mean(arr, axis=1))

A

axis=1: Werkt rij per rij (over de kolommen)