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] )

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

How do you sort a numpy array ‘arr’?

A

arr.sort()

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

What does the following do: ————————————————– from collections import Counter top_5_words = Counter(words).most_common(5) print(top_5_words)

A
  1. 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does pip stand for?

A

pip stands for pip installs python.

It is a recursive acronym.

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