Used in Datacamp Software Engineering course Flashcards
1
Q
How do you create an array ‘arr’ using the numpy package?
A
arr = np.array( [1, 2, 3, …, 10] )
2
Q
How do you sort a numpy array ‘arr’?
A
arr.sort()
3
Q
What does the following do: ————————————————– from collections import Counter top_5_words = Counter(words).most_common(5) print(top_5_words)
A
- It imports the Counter module from the ‘collections’ python package 2. It uses ‘Counter’ on the object ‘words’ to select the top 5 most common words. 3. Then it prints it to the console
4
Q
What does pip stand for?
A
pip stands for pip installs python.
It is a recursive acronym.
5
Q
A