0% found this document useful (0 votes)
9 views6 pages

Week-6 Lab Print

aitta

Uploaded by

22331a1237
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views6 pages

Week-6 Lab Print

aitta

Uploaded by

22331a1237
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Week-6 22331a1237

1.Aim: Write a program to read pandas CSV files.

Theory:
Data preprocessing is a process of preparing the raw data and making it suitable for a
machine learning model. It is the first and crucial step while creating a machine learning
model. When creating a machine learning project, it is not always the case that we come
across clean and formatted data.

Program:

import pandas as pd

data=pd.read_csv("/content/data.csv")

data.head()

Output:
2.Aim: Write a program to print information about a CSV file.

Theory:
Data preprocessing is a process of preparing the raw data and making it suitable for a
machine learning model. It is the first and crucial step while creating a machine learning
model. When creating a machine learning project, it is not always a case that we come
across clean and formatted data.

Program:

import pandas as pd

data=pd.read_csv("/content/data.csv")

data.info()

Output:
3.Aim: Write a program for is null command.

Theory:
Data preprocessing is a process of preparing the raw data and making it
suitable for a machine learning model. It is the first and crucial step while
creating a machine learning model. When creating a machine learning project,
it is not always a case that we come across clean and formatted data.

Program:

import pandas as pd

data=pd.read_csv("/content/data.csv")

pd.isnull(data)

Output:
4. Aim: Write a program to describe commands.

Theory:
Data preprocessing is a process of preparing the raw data and making it suitable for a machine
learning model. It is the first and crucial step while creating a machine learning model. When
creating a machine learning project, it is not always a case that we come across clean and
formatted data.

Program:

import pandas as pd

data=pd.read_csv("/content/data.csv")

data.describe()

Output:
5.Aim: Find the null values in the dataset.

Theory:
Data preprocessing is a process of preparing the raw data and making it suitable for a
machine learning model. It is the first and crucial step while creating a machine learning
model. When creating a machine learning project, it is not always a case that we come
across clean and formatted data.

Program:

import pandas as pd

data=pd.read_csv("/content/data.csv")

pd.isnull(data).sum()

Output:
6.Aim: Rename the column name in dataset

Theory:
Data preprocessing is a process of preparing the raw data and making it suitable for a
machine learning model. It is the first and crucial step while creating a machine learning
model. When creating a machine learning project, it is not always a case that we come across
clean and formatted data.

Program:

import pandas as pd
data=pd.read_csv("/content/data.csv")
data.rename(columns={"Close/Last":"C/L"}, inplace= True)
data.head()

Output:

You might also like