Featured
- Get link
- X
- Other Apps
visualization using Numpy and Matplotlib
Today we are going to discuss on data visualization using Numpy and Matplotlib. This are one of the best python libraries for data scientists. Numpy is widely known for its working with arrays making it suitable for dealing with numerical data. Matplotlib on the other hand is widely known for its capabilities of creating visually attractive plots from the data provided, this means that if you want to create bar, histograms, line graphs, scatter points, 3D plots, animated plots etc then matplotlib might be your best friend.
The best part is that to achieve your goal, you only use few lines of code. This means that debugging will be easy and will save you a lot of time plus you'll be Happier coding.
Numpy and Matplotlib are powerful combination for data visualization in python. Numpy provides the foundation for efficient data manipulation and storage.
Before we continue, let's take a look at the functionalities of this libraries.
1. Numpy
2. Matplotlib
Examples
import numpy as np
import matplotlib.pyplot as plt
Data_X = np.array([1,2,3,4,5])
Data_Y = np.array([70,45,67,56,23])
plt.bar(Data_X,Data_Y)
plt.show()
//We first import both Numpy and Matplotlib in the first 2 lines.
//Data_X is the data to be shown on the X axis and Data_Y is the data to be displayed on the y-axis
//We use plt.bar() to tell matplotlib that we want a bar graph of the specific data.
//We use plt.show() to draw the plot.
//You should be able to get an output if you run the above code.
This is just a sample of the 2 libraries in use, you can always go beyond this and use real world data to create complex data visualizations.Advantages of using Numpy and Matplotlib
Disadvantages of using Numpy and Matplotlib
- Get link
- X
- Other Apps
Comments
Post a Comment