Importing library function in python

      There are many libraries which are readily available in python which make your job easy. python libraries like numpy (for data processing) matplotlib (for ploting graphs) pandas (for data importing and manipulation ) are very extensively used for data pre processing. There is a well built library called as sklearn that contains most of the machine learning models of regressions and classifiers like liner regression, SMV, Decision tree, Random Forest.

Python code to import these libraries are :

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

and thats it, only one sentance to import the library you require.

example of using methods of these class is as follows:

a = np.array([1,2,3])

in this code i am using numpy which is imported as np fyi: you can use alias instead of np for example import nupmy as xyz

then we can use it as a= xyz.array([1,2,3])

array is a method of numpy which converts data like imported dataset or arrays into numpy array. numpy array finds extensive use in data pre processing.

Posted on by