dictionaries and numpy Flashcards

1
Q

Creating a dictionary

A

dictionary = {“key1” : “value1”, “key2” = “value2”}

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

print out all keys of a dictionary

A

print(dict.keys())

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

remove a pair from a dictionary

A

del(dict[‘key_to_remove’])

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

print out a value in a dictionary of dictionaries

A

print(dict[‘level1key’][‘level2key’]

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

Boolean operators in numpy

A

np. logical_and(var1 > 0, var2 > 0)
np. logical_or()
np. logical_not()

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