Final Exam Flashcards

1
Q

What does IP do?

A

It packages the data?

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

What does stream=True do in requests.get?

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

What is included as the second argument in beautiful soup?

A

“html.parser”

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

When is .content typically used with beautiful soup?

A

For binary data (like images)

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

What is .text used for in beautiful soup?

A

Text based content…like

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

How do you find all tags with a particular attribute with beautiful soup?

A

Soup.find_all(”tag_name”, attribute_name<optionally = text>)

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

How can you use regular expressions to find tags with a certain ending?

A

Tags = beautiful soup.find_all(’tag_name’, attribute_name=re.compile(r’.jpg$’))

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

What does status code 404 mean?

A

Not found

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

What does status code 500 do?

A

Internal server error

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

Can you use find_all on specific tags?

A

Yes

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

What are the five types of plots for matplotlib?

A
  1. Plot
  2. Scatter
  3. Bar
  4. Hist
  5. Pie
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you save a figure with matplotlib?

A

plt.savefig(”file_name”)

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

Ow do you add a title in matplot lib?

A

plt.title(string)

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

How do you add labels in matplotlib?

A

plt.xlabel(label_name), plt.ylabel(label_name)

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

How do you add a legend in matplotlib?

A

ply.plot(x, y,label=”label_name”)

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

What does re.search(pattern, string) do?

A

It returns a match object representing the first occurrence of pattern in the string.

17
Q

What does re.fullmatch(pattern,string) do?

A

It returns a match object, requiring that the pattern matches the entirety of the string

18
Q

What does re.match(pattern, string) do?

A

It returns a match object, requiring that the string starts with a substring that matches the pattern

19
Q

what does re.sub(pattern, repl, string) do?

A

It substitutes all matches of a pattern within string with repl