Python Programming 2 Class 12 MCQ, This chapter provides a fundamental python programming MCQs. Students will gain hands-on experience with essential Python libraries, preparing them for more advanced data analysis and machine learning tasks which can be incorporated in their capstone project.
Python Programming 2 Class 12 MCQ
1. Which of the following is a primary data structure in Pandas?
a) List
b) Tuple
c) Series
d) Matrix
2. What does the fillna(0) function do in Pandas?
a) Removes rows with missing values
b) Fills missing values with zeros
c) Estimates missing values based on averages
d) Converts all data to zero
3. In Linear Regression, which library is typically used for importing and managing data?
a) NumPy
b) Pandas
c) Matplotlib
d) Scikit-learn
4. What is the correct syntax to read a CSV file into a Pandas DataFrame?
a) pd.DataFrame(“filename.csv”)
b) pd.read_csv(“filename.csv”)
c) pandas.read_file(“filename.csv”)
d) pd.file_read(“filename.csv”)
5. What is the result of the df.shape function?
a) Data type of the DataFrame
b) Number of rows and columns in the DataFrame
c) Memory usage of the DataFrame
d) Column names of the DataFrame
6. Which function exports a DataFrame to a CSV file?
a) export_csv()
b) to_file()
c) to_csv()
d) save_csv()
7. _ is a collection of pre-written code that performs common tasks.
a. Python libraries
b. Python Pandas
c. Python dataset
d. None of the above
8. __ Python libraries handle large datasets.
a. NumPy
b. Pandas
c. Both a) and b)
d. None of the above
9. __ Python library used for numerical computing.
a. SciPy
b. TensorFlow
c. NumPy
d. Matplotlib
10. How you can import the NumPy library in Python.
a. Insert numpy as np
b. import numpy as np
c. import numpy in np
d. None of the above
11. How will you create an array in Python?
a.
import numpy as np
arr = np.array([1, 2, 3])
b.
insert numpy as np
arr = array([1, 2, 3])
c.
import numpy as np
arr = array([1, 2, 3])
d.
import numpy as np
arr = np([1, 2, 3])
import numpy as np
arr = np.array([1, 2, 3])
12. Which of the following data structures are provided by Pandas?
a. Series
b. Data Frame
c. Both a) and b)
d. None of the above
13. How will you create a series using scalar values in a pandas data structure?
a. import pandas as pd
series1 = pd.series([10,20,30])
b. insert pandas as pd
series1 = pd.series([10,20,30])
c. import pandas as pd
series1 = series([10,20,30])
d. import pandas as pd
series1 = pd([10,20,30])
series1 = pd.series([10,20,30])
14. CSV stands for _.
a. Commercial Separated Values
b. Comma Separated Values
c. Comman Separated Values
d. None of the above
15. Which of the following library tools is used to read CSV files into data frames?
a. NumPy
b. Pandas
c. Matplotlib
d. None of the above
16. Which of the following functions is used to import tabular data from a CSV file into a pandas DataFrame?
a. import_csv()
b. read_csv()
c. to_csv()
d. None of the above
17. Which of the following functions is used to save a dataframe to a text or CSV file?
a. import_csv()
b. read_csv()
c. to_csv()
d. None of the above
18. How can you handle missing values in Python?
a. Drop the row having missing values.
b. Estimate the missing value.
c. Both a) and b)
d. None of the above
19. Which function is used to check if the value is missing or not in the DataFrame?
a. null()
b. is_null()
c. isnull()
d. None of the above
20. Which function removes the entire row (object) having the mission value?
a. delete()
b. remove()
c. dropna()
d. None of the above
21. Which function is used to replace missing value(s) with the values specified in num?
a. fillna()
b. fill()
c. missing()
d. duplicate()
Disclaimer: We have taken an effort to provide you with the accurate handout of “Python Programming 2 Class 12 MCQ“. If you feel that there is any error or mistake, please contact me at anuraganand2017@gmail.com. The above CBSE study material present on our websites is for education purpose, not our copyrights. All the above content and Screenshot are taken from Artificial Intelligence Class 12 CBSE Textbook, Sample Paper, Old Sample Paper, Board Paper and Support Material which is present in CBSEACADEMIC website, This Textbook and Support Material are legally copyright by Central Board of Secondary Education. We are only providing a medium and helping the students to improve the performances in the examination.
Images and content shown above are the property of individual organizations and are used here for reference purposes only.
For more information, refer to the official CBSE textbooks available at cbseacademic.nic.in