Week-6 Lab Print
Week-6 Lab Print
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: