Machine Learning Lab Set1
Machine Learning Lab Set1
T.Dasarahalli, Bengaluru.
Department of Computer Applications
Installation of Python
Type “Python download” in the Google search bar and press Enter key. In the list of links shown, select the
very link or click on the official website link: https://www.python.org/downloads/
Choose the correct link for your device from the options provided: either Windows installer (64-bit) or
Windows installer (32-bit) and proceed to download the executable file.
Once you have downloaded the installer, open the .exe file, such as python-3.11.5-amd64.exe, by double-
clicking it to launch the Python installer. Choose the option to install the launcher for all users by checking
the corresponding checkbox, so that all users of the computer can access the Python launcher application.
Enable users to run Python from the command line by checking the Add python.exe to PATH checkbox. After
Clicking the Install Now Button the setup will start installing Python on your Windows system.
After successful installation of Python, close the installation window. You can check if the installation of
Python was successful by using either the command line or the Integrated Development Environment (IDLE),
which you may have installed. To access the command line, click on the Start menu and type “cmd” in the
search bar.
Then click on Command Prompt, type the command “python –V” or “python –version”. You can see installed
version of Python on your system.
Go to Python Integrated Development Environment (IDLE). In Windows search bar, type IDLE and you can
see “IDLE (Python 3.11.64- bit)”. Open IDLE on the IDLE screen itself you can see version. This gives the
conformation of successful installation of python.
NumPy is an open-source Python library that facilitates efficient numerical operations on large quantities of
data. There are a few functions that exist in NumPy that we use on pandas DataFrames. The most important
part about NumPy is that pandas is built on top of it which means Numpy is required for operating the Pandas.
It is defined as a Python package used for performing the various numerical computations and processing of
the multidimensional and single-dimensional array elements. The calculations using Numpy arrays are faster
than the normal Python array. It is also capable of handling a vast amount of data and convenient with Matrix
multiplication and data reshaping. Steps to install Numpy is,
Or
Or
Step 4: On the successful installation, you can type following two commands at command prompt. If python
prompt “>>>” appears then package is successfully installed.
1. C:\Users\DELL>python
2. >>>import numpy
Pandas is a very popular library for working with data (its goal is to be the most powerful and flexible open-
source tool, and in our opinion, it has reached that goal). DataFrames are at the center of pandas. A
DataFrame is structured like a table or spreadsheet. The rows and the columns both have indexes, and you
can perform operations on rows or columns separately. It can perform five significant steps required for
processing and analysis of data irrespective of the origin of the data, i.e., load, manipulate, prepare, model,
and analyze. Steps to install pandas is,
Or
Or
Step 4: On the successful installation, you can type following two commands at command prompt. If python
prompt “>>>” appears then package is successfully installed.
1. C:\Users\DELL>python
2. >>>import pandas