(PART A – 2 Marks)
UNIT - I
Q. No Questions
Write the code to print the number is divisible by 12?
n=int(input("Enter a number:"))
if(n%12==0):
*QA101 print("The Given Number is divisible by 12")
else:
print("The Given Number is not divisible by 12")
List out the data types?
Numbers
Strings
Booleans
QA102
Lists
Tuples
Dictionaries
Sets
Define square(sqr)?
QA103 def sqr(n):
return n*n
Define concat?
QA104 def concat(a,b):
return a+b
Print your age ?using calculation(code)
*QA105 An age
17
What is Data Science?
Data science is the area of study which involves methods to analyze massive amounts of
QA106
data and extracting knowledge from all the data that are gathered.
, What are the needs of data science?
The basic needs of data science are:
Better Decision Making
QA107
Predictive Analysis
Pattern Discovery
What are the different built-in data types in Python?
Python uses many built-in data types.
QA108
What is the lambda function?
These are anonymous or nameless functions.
Lambda functions are anonymous as they aren’t declared in the standard manner using the def keyword. Further, it
doesn’t even need the return keyword. Both are implicit in the function.
These functions have their local namespace and don’t have any access to variables other than those in their perimeter list
QA109
and those in the global namespace.
Examples: x = lambda i,j: i+j
print (x(7,8))
Output: 15
QA110 What are built-in data types in Python?
Python data types define the variable type. Here are a few built-in data types in Python:
Numeric (int, float, and complex)
String (str)
Sequence (list, tuple, range)
Binary (bytes, byte array, memory view)
, Set (set)
Boolean (bool)
Mapping (dict)
UNIT - II
Q. No Questions
Explain numpy and sample code?
*QA201 import numpy as np
np.random.rand(3,4)
Write the code using data frame?
import pandas as pd
QA202 d = {'one' : pd.Series([1, 2, 3], index=['a', 'b', 'c']), 'two' : pd.Series([4,5,6],index=['a', 'b', 'c'])}
k=pd.DataFrame(d)
k['one']
Write syntax for pandas series & pandas dataframe?
QA203 pandas.Series( data, index, dtype, copy)
pandas.DataFrame( data, index, columns, dtype, copy)
Write the code for printing array?
import numpy as np
output_array = np.array([0, 1, 2, 3, 4, 5])
*QA204
print(output_array)
Output: array([0, 1, 2, 3, 4, 5])
Output: array([2, 4, 6, 8])
Explain SciPy?
SciPy is an open source Python library which is used to solve scientific and mathematical problems. The SciPy library depends
QA205 on NumPy, which provides convenient and fast N dimensional array manipulation
QA206 What are the commonly used Python libraries for data science?
TensorFlow
SciPy
NumPy
Pandas
, Matplotlib
Keras
Scikit-learn
PyTorch
Scrapy
BeautifulSoup
What is the difference between del(), clear(), remove(), and pop()?
del(): Deletes the with respect to the value's position. Which value was deleted is not returned. It also changes the index
to the right by decreasing it by one value. It could also be used to delete the complete data structure.
QA207 clear(): Clears the list.
remove(): Since it deletes in relation to the value, you can use it if you know which particular value to remove.
pop(): By default, delete the last element and return the deleted value. It is frequently employed for creating referencing.
What is the difference between a Series and a DataFrame in Pandas?
Series can only contain a single list with an index, whereas a DataFrame contains more than one series.
QA208 A series is a one-dimensional array that supports any datatype, including integers, float, strings, etc. In contrast, a
dataframe is a two-dimensional data structure with columns that can support different data types.
List a few methods of NumPy array.
np.means()
QA209 np.cumsum()
np.sum(),
What is the difference between series and vectors?
Vectors: It can only assign values for index position as 0,1,…, (n-1).
QA210 Series: It only has one column. Series can be created from the array, list, and dictionaries. For every data series, it can
assign unique index position values.
UNIT - III
Q. No Questions
UNIT - I
Q. No Questions
Write the code to print the number is divisible by 12?
n=int(input("Enter a number:"))
if(n%12==0):
*QA101 print("The Given Number is divisible by 12")
else:
print("The Given Number is not divisible by 12")
List out the data types?
Numbers
Strings
Booleans
QA102
Lists
Tuples
Dictionaries
Sets
Define square(sqr)?
QA103 def sqr(n):
return n*n
Define concat?
QA104 def concat(a,b):
return a+b
Print your age ?using calculation(code)
*QA105 An age
17
What is Data Science?
Data science is the area of study which involves methods to analyze massive amounts of
QA106
data and extracting knowledge from all the data that are gathered.
, What are the needs of data science?
The basic needs of data science are:
Better Decision Making
QA107
Predictive Analysis
Pattern Discovery
What are the different built-in data types in Python?
Python uses many built-in data types.
QA108
What is the lambda function?
These are anonymous or nameless functions.
Lambda functions are anonymous as they aren’t declared in the standard manner using the def keyword. Further, it
doesn’t even need the return keyword. Both are implicit in the function.
These functions have their local namespace and don’t have any access to variables other than those in their perimeter list
QA109
and those in the global namespace.
Examples: x = lambda i,j: i+j
print (x(7,8))
Output: 15
QA110 What are built-in data types in Python?
Python data types define the variable type. Here are a few built-in data types in Python:
Numeric (int, float, and complex)
String (str)
Sequence (list, tuple, range)
Binary (bytes, byte array, memory view)
, Set (set)
Boolean (bool)
Mapping (dict)
UNIT - II
Q. No Questions
Explain numpy and sample code?
*QA201 import numpy as np
np.random.rand(3,4)
Write the code using data frame?
import pandas as pd
QA202 d = {'one' : pd.Series([1, 2, 3], index=['a', 'b', 'c']), 'two' : pd.Series([4,5,6],index=['a', 'b', 'c'])}
k=pd.DataFrame(d)
k['one']
Write syntax for pandas series & pandas dataframe?
QA203 pandas.Series( data, index, dtype, copy)
pandas.DataFrame( data, index, columns, dtype, copy)
Write the code for printing array?
import numpy as np
output_array = np.array([0, 1, 2, 3, 4, 5])
*QA204
print(output_array)
Output: array([0, 1, 2, 3, 4, 5])
Output: array([2, 4, 6, 8])
Explain SciPy?
SciPy is an open source Python library which is used to solve scientific and mathematical problems. The SciPy library depends
QA205 on NumPy, which provides convenient and fast N dimensional array manipulation
QA206 What are the commonly used Python libraries for data science?
TensorFlow
SciPy
NumPy
Pandas
, Matplotlib
Keras
Scikit-learn
PyTorch
Scrapy
BeautifulSoup
What is the difference between del(), clear(), remove(), and pop()?
del(): Deletes the with respect to the value's position. Which value was deleted is not returned. It also changes the index
to the right by decreasing it by one value. It could also be used to delete the complete data structure.
QA207 clear(): Clears the list.
remove(): Since it deletes in relation to the value, you can use it if you know which particular value to remove.
pop(): By default, delete the last element and return the deleted value. It is frequently employed for creating referencing.
What is the difference between a Series and a DataFrame in Pandas?
Series can only contain a single list with an index, whereas a DataFrame contains more than one series.
QA208 A series is a one-dimensional array that supports any datatype, including integers, float, strings, etc. In contrast, a
dataframe is a two-dimensional data structure with columns that can support different data types.
List a few methods of NumPy array.
np.means()
QA209 np.cumsum()
np.sum(),
What is the difference between series and vectors?
Vectors: It can only assign values for index position as 0,1,…, (n-1).
QA210 Series: It only has one column. Series can be created from the array, list, and dictionaries. For every data series, it can
assign unique index position values.
UNIT - III
Q. No Questions