0% found this document useful (0 votes)
72 views2 pages

Question Bank of Data Science Laboratory

The document contains a list of programming tasks primarily focused on data manipulation and analysis using Python and R. Tasks include handling null values, predicting outcomes using machine learning, creating visualizations, and working with datasets like 'Students data' and 'Mall_Customers'. Each task is designed to enhance skills in data science and programming.

Uploaded by

aissmsra
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)
72 views2 pages

Question Bank of Data Science Laboratory

The document contains a list of programming tasks primarily focused on data manipulation and analysis using Python and R. Tasks include handling null values, predicting outcomes using machine learning, creating visualizations, and working with datasets like 'Students data' and 'Mall_Customers'. Each task is designed to enhance skills in data science and programming.

Uploaded by

aissmsra
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/ 2

10 Marks Questions

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)

7) Write a python program to print the number of outliers in following dataset


8) 1,2,2,2,3,1,1,15,2,2,2,3,1,1,2
9) Write a python program to find all null values in Play Tennis dataset and replace them with
star(*).

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

Company Model Year


TATA Nexon 2017
MG Astor 2021
KIA Seltos 2019
HYUNDAI Creta 2015

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)

21) Create a vector x of following numbers.31,26,36,14,45,28,39,51,33,34,21,11,12,35,20


Then,
a) Create a vector y containing elements numbered 3rd, 7th, 8th and 13th of vector x.
b) Create a vector z containing elements of x >25.
c) Create a vector v containing elements between15 to 40
d) Create a vector u containing elements ox x<40
22) Write a python program to find all null values in “Students data” dataset and remove them.
23) Write a Python program to find mean and standard deviation of Annual income column of
Mall_Customers dataset.
24) Write a Python program to rescale data between (0, 2) the ‘Wholesale customers’ dataset

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.

You might also like