Question Bank of Data Science Laboratory
Question Bank of Data Science Laboratory
1) Write a python program to find all null values in “Students data” dataset and replace them
with zero.
2) Write a Python program to predict test result and test accuracy of the result for following
(complete the code)
import numpy as np
import matplotlib.pyplot as mtp
import pandas as pd
df=pd.read_csv(‘file path/User_Data.csv')
df
x=df.iloc[:,[2,3]];x
y=df.iloc[:,4];y
from sklearn.model_selection import train_test_split
x_train,x_test,y_train,y_test=train_test_split(x,y,test_size=0.25,random_state=0)
print(y_test)
from sklearn.preprocessing import StandardScaler
st_x = StandardScaler()
x_train = st_x.fit_transform(x_train);x_test = st_x.fit_transform(x_test)
x_test
from sklearn.tree import DecisionTreeClassifier
classifier=DecisionTreeClassifier(criterion='entropy',random_state=0)
classifier.fit(x_train,y_train
3) Write an R program to reverse a given number and also calculate the sum of digits of that
number. (number is 526)
4) Write a Python program to extract dependent and independent variables from diabetes dataset.
5) Write a python program to create Scatter plot of Sepal length against Petal length.
6) Write a python program the Categorical values in numeric format for a given dataset.
(Import Mall_Customers dataset)
10) Write a python program to find all null values in “Students data” dataset and replace null
values mean of the column.
11) Write a Python program to build SVM model to iris dataset. The Dataset is available in the
scikit-learn library.
12) Write a python program to splitting the Groceries dataset into training and testing set.
13) Write a Python program to create data frame of following information using pandas
14) Write a python program to rescale the data between 0 and 1. (use inbuilt dataset)
15) Write R program to Create a Bar plot to show speed of cars and also create scatter plot
between speed and distance of cars (use inbuilt dataset cars).
16) Write a python program to show following result on the “Salary_Data” dataset.
17)
18) Write a Python program to Standardized the ‘Wholesale customers’ dataset
19) Write a python program to convert Categorical values in numeric format for Play Tennis
dataset.
20) Write R program to reverse a number and also calculate the sum of digits of that
number.(number=369)
25) Write R program to Create a Bar plot to show petal length of flowers and also create scatter
plot between sepal length and petal length. (Use inbuilt dataset iris).
26) Write a Python program to extract dependent and independent variables using iloc function
of any dataset from final dataset folder.