Matplotlib

Matplotlib is a popular data visualization library in Python, which is widely used in Data Engineering to plot and analyze data. With Matplotlib, you can create a wide range of charts and graphs including line charts, bar charts, scatter plots, histograms, and more.

Here are some common use cases of Matplotlib in Data Engineering:

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

# Create a datetime index
dates = pd.date_range('2022-01-01', '2022-12-31', freq='D')

# Create a random list of values
values = np.random.randint(1, 100, len(dates))

# Create a DataFrame with datetime and value columns
df = pd.DataFrame({'date': dates, 'value': values})

# Set the index to the date column
df.set_index('date', inplace=True)

# Create a line chart of the data
plt.plot(df.index, df['value'])

# Add a title and axis labels
plt.title('Value Over Time')
plt.xlabel('Date')
plt.ylabel('Value')

# Display the chart
plt.show()

Learn Numpy : https://learndataengineeringskills.com/numpy/

Data Engineering :https://learndataengineeringskills.com/data-engineering/

 

Leave a Comment