Introduction to Numpy | Pandas | Matplotlib
Introduction to Numpy | Pandas | Matplotlib
Introduction
If you are starting to learn Data Visualization or Data Science in particular you must have heard or trying to learn about Pandas, or Numpy, or Matplotlib. This article will serve you the very basic and informative introduction to these keeping in mind the practical essence of code. It is very important to first understand the theory first and then to understand code, and if possible try to implement it in parallel, making sure that the resources that are required are fulfilled at an earlier stage.
What is Numpy
Numpy is a Python package for scientific computing, adding support to linear algebra, matrices, and Fourier transform. In fact, Numpy is an abbreviation of Numerical Python. One of the premier use of Numpy is in the field of the multidimensional container of generic data. In the case of Numpy, the array here is called as ndarray. Numpy serves as a function as Reshaping arrays, or aggregation or filtering or Statistical model, and many more.
import numpy as np
array1 = np.array([16,14,85])
print("Rank 1: \n",array1)
array2 = np.array([1, 2, 3],[8,6,7])
print(" Rank 2: \n",array2)
What is Pandas
Pandas is a powerful tool used for data manipulation and analysis, it enables operations in a process where the operations for data manipulation and analysis are needed for desired structured output. It's fast and open-sources built on top of Python programming language.
import pandas as pd
a = pd.Series([4,8,6,3,1,9,7,2,0])
b = pd.Series([6.0,8.2,6.4,7.4,9.0,8.8])
c = pd.Series(['one','two','three','four','five'])
exe ={'first':a, 'second':b, 'third':c}
df = pd.DataFrame(exe)
What is Matplotlib
When it comes to visualizations with python then matplotlib is an important library for visualizations, it enables to deliver data to get understand in a visual form. The matplotlib library is very extensive and very much feature-rich.
To create a histogram:
from matplotlib import pyplot as plt
y = [12,14,18,11,10]
plt.hist(y)
plt.show()
To create a line plot:
from matplotlib import pyplot as plt
x1 = [6,7,8,9,1]
y1 = [7,5,6,3,9]
plt.plot(x1,y1)
plt.show()
Note: The above was the basic introduction and with examples, look for documentation to understand more and practice more to have a grip. The more you practice the more you understand and have depth.