{ "@context": "https://schema.org", "@type": "Organization", "name": "Brainscape", "url": "https://www.brainscape.com/", "logo": "https://www.brainscape.com/pks/images/cms/public-views/shared/Brainscape-logo-c4e172b280b4616f7fda.svg", "sameAs": [ "https://www.facebook.com/Brainscape", "https://x.com/brainscape", "https://www.linkedin.com/company/brainscape", "https://www.instagram.com/brainscape/", "https://www.tiktok.com/@brainscapeu", "https://www.pinterest.com/brainscape/", "https://www.youtube.com/@BrainscapeNY" ], "contactPoint": { "@type": "ContactPoint", "telephone": "(929) 334-4005", "contactType": "customer service", "availableLanguage": ["English"] }, "founder": { "@type": "Person", "name": "Andrew Cohen" }, "description": "Brainscape’s spaced repetition system is proven to DOUBLE learning results! Find, make, and study flashcards online or in our mobile app. Serious learners only.", "address": { "@type": "PostalAddress", "streetAddress": "159 W 25th St, Ste 517", "addressLocality": "New York", "addressRegion": "NY", "postalCode": "10001", "addressCountry": "USA" } }

Programming Part 4 Flashcards

(25 cards)

1
Q

What is matplotlib?

A

A Python library for creating static, animated, and interactive visualizations.

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

How do you import matplotlib?

A

import matplotlib.pyplot as plt

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

How do you create a basic line plot?

A

plt.plot(x, y)

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

How do you display a plot in matplotlib?

A

plt.show()

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

How do you add a title to a plot?

A

plt.title(‘My Title’)

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

How do you create a scatter plot?

A

plt.scatter(x, y)

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

How do you create a bar chart?

A

plt.bar(categories, values)

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

How do you create a histogram?

A

plt.hist(data)

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

How do you create a boxplot?

A

plt.boxplot(data)

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

How do you create a pie chart?

A

plt.pie(sizes, labels=labels)

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

How do you label the x-axis in a plot?

A

plt.xlabel(‘Label’)

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

How do you label the y-axis in a plot?

A

plt.ylabel(‘Label’)

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

How do you change the figure size?

A

plt.figure(figsize=(10, 5))

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

How do you add a legend to a plot?

A

plt.legend()

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

How do you save a plot to a file?

A

plt.savefig(‘filename.png’)

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

What is seaborn?

A

A statistical data visualization library built on top of matplotlib.

17
Q

How do you import seaborn?

A

import seaborn as sns

18
Q

How do you create a distribution plot?

A

sns.histplot(data)

19
Q

How do you create a boxplot in seaborn?

A

sns.boxplot(x=’category’, y=’value’, data=df)

20
Q

How do you create a scatter plot with regression line?

A

sns.regplot(x=’x’, y=’y’, data=df)

21
Q

How do you set a visual theme in seaborn?

A

sns.set_theme(style=’darkgrid’)

22
Q

How do you show the plot in seaborn?

A

Using plt.show(), same as matplotlib.

23
Q

How do you create a heatmap?

A

sns.heatmap(data)

24
Q

How do you create a pairplot?

A

sns.pairplot(df)

25
How do you display summary stats in a plot?
sns.catplot(..., kind='box') or sns.violinplot(...)