Posts

Machine Learning Post

Image
 Machine Learning Machine learning is the computer programm which we feed with the past data(structured/unstructured) so, the machine will learn the patterns in it and predict the outcome. Basic setup Open terminal/virtual studio terminal/cmd Create a folder and name it $  mkdir Machine_learning $   cd Machine_learning Create virtual envirinment with name i gave env  $ virtualenv env Activate the virtual environment $ source env/bin/activate Now installing machine learning libraries $ pip install pandas Pandas is required for data manipulation purpose $ pip install matplotlib Matplotlib is for data visualization purpose $ pip install scikit-learn It will install scikit-learn along with dependencies The scikit-learn come up with bunch of models which we going to use one of the model Machine Learning Architecture: Now lets begin our first machine learning code: Here my idea is to show you the theme of how machine learning helps in real world with small snippet of ...

DataFrames in pandas

Creating Data Frame:      A pandas dataframe can be created using various inputs like Lists Dictionaries Series Numpy ndarray DataFrame    Creating DataFrame using lists: import pandas as pd df1=pd.DataFrame()#creating empty dataframe print(df1) list1=[1,2,3,4,5] df2=pd.DataFrame(list1) print(df2)     Output: Empty DataFrame Columns: [] Index: []    0 0  1 1  2 2  3 3  4 4  5 Creating DataFrames using customs index: import pandas as pd l1=[10,20,30,40,50] df1=pd.DataFrame(l1,index=['a','b','c','d','e']) print(df1) l2=[10,20,30,40,50] df2=pd.DataFrame(l2,index=['a','b','c','d','e'],columns=['s.no']) l3=[['Akbar',30],['Amar',21],['Babar',32]] df3=pd.DataFrame(l3,index=['e1','e2','e3'],columns=['emp_Name','Age']) print(df2) print(df3) Output:     0 a  10 b  20 c  30 d  40 e  50    s.no a    ...

Numpy in Python

Image
What is Numpy Numpy or Numerical Python is an open source python library for doing scientific computing calculations.     It gives an ability to create multidimensional array(is a collection of similar data elements)objects and perform faster mathematical opertions. The main objective of numpy is n-dimensional array.             How to work with numpy     To work with numpy on your  system we have to install numpy package in standard python. so, to do this open command line in your system and give command which follows $ pip install numpy Creating numpy array         To create a numpy array we need to pass list of element values inside a square brackets as an variable to the np.array() function. Consider a programm with a different datatypes representing using array function import numpy as np a1=np.array([1,2,3,4,5]) a2=np.array([1.2,3.4,4.5,2.4]) a3...

Python Introduction

       Python is the fastest growing language in terms of number of developers who are using it, number of companies who are using and also number of areas that are impementing it. The basic fundamental points to know about python is What is python Why we use python What is python:         Python is a high level programming language and all high level languages are portable in nature. Portability allows to develop applications irrepective of hardware it means for same code you can run in any OS without making any changes to it.        Python is a multiparadigm. A programming paradigm define set of rules and regulations to organize data and instructions        Python is a general purpose programming language. A programming language used to  develop any kind of applications or softwares Why we use python:        Some of the  features that makes everyone to u...