dictionaries and numpy Flashcards
1
Q
Creating a dictionary
A
dictionary = {“key1” : “value1”, “key2” = “value2”}
2
Q
print out all keys of a dictionary
A
print(dict.keys())
3
Q
remove a pair from a dictionary
A
del(dict[‘key_to_remove’])
4
Q
print out a value in a dictionary of dictionaries
A
print(dict[‘level1key’][‘level2key’]
5
Q
Boolean operators in numpy
A
np. logical_and(var1 > 0, var2 > 0)
np. logical_or()
np. logical_not()