How do you visualize data in python? (AI) Flashcards

(4 cards)

1
Q

What is the foundational and most widely-used Python data visualization library, offering extensive control over plot elements?

A

Matplotlib. It is a low-level, highly customizable library for creating static, animated, and interactive 2D plots.

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

Which library, built on Matplotlib, simplifies the creation of aesthetically pleasing statistical graphics with less code and works well with pandas DataFrames?

A

Seaborn. It provides a high-level interface and built-in themes for creating complex visualizations like heatmaps and violin plots.

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

Which libraries are best for creating interactive, web-based visualizations and dashboards with features like hover tooltips and zoom?

A

Plotly and Bokeh. Plotly offers a wide range of 2D and 3D plots, while Bokeh specializes in high-performance streaming data visualizations for modern web browsers.

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

Matplotlib code example

A
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

Generate Sample Data
np.random.seed(0)
x = np.random.randn(100)
y = 2.5 * x + np.random.randn(100)

Create DataFrame
df = pd.DataFrame({'X': x, 'Y': y})

Plot Scatter with Matplotlib
plt.figure(figsize=(8, 4))
plt.title('Scatter Plot: X vs. Y')
plt.scatter('X', 'Y', data=df)
plt.xlabel('X')
plt.ylabel('Y')
How well did you know this?
1
Not at all
2
3
4
5
Perfectly