1.
Which of the following thing can be data in Pandas?
Correct Answer
D. All of the mentioned
Explanation
In Pandas, all of the mentioned options can be considered as data. Pandas is a powerful data manipulation library in Python that provides data structures like DataFrame and Series to handle and analyze data. It can handle data in various forms such as a python dict, an ndarray (NumPy array), or a scalar value. These different data types can be stored and manipulated efficiently using Pandas functions and methods. Therefore, the correct answer is "all of the mentioned".
2.
Point out the correct statement.
Correct Answer
B. NaN is the standard missing data marker used in pandas
Explanation
The correct statement is that NaN is the standard missing data marker used in pandas. In pandas, missing values are often represented as NaN, which stands for "Not a Number". This allows for easy identification and handling of missing data in data analysis and manipulation tasks.
3.
Which of the following input can be accepted by DataFrame?
Correct Answer
D. All of the mentioned
Explanation
A DataFrame in pandas can accept all of the mentioned inputs, which include a structured ndarray, a Series, and another DataFrame. This means that a DataFrame can be created from any of these input types, allowing for a versatile and flexible data manipulation and analysis tool.
4.
Point out the wrong statement.
Correct Answer
A. A DataFrame is like a fixed-size dict in that you can get and set values by index label
Explanation
The given statement "A DataFrame is like a fixed-size dict in that you can get and set values by index label" is incorrect. A DataFrame is not like a fixed-size dict, as it is a two-dimensional data structure that can store data of different types, whereas a fixed-size dict can only store data of the same type. Additionally, in a DataFrame, you can get and set values not only by index label but also by column name.
5.
All pandas data structures are ___ mutable but not always _______mutable.
Correct Answer
C. Value, size
Explanation
All pandas data structures are mutable, meaning that they can be modified after they are created. However, they are not always size mutable, which means that the size of the data structure cannot always be changed once it is created. This is because some pandas data structures, such as Series and DataFrame, have a fixed size once they are created, while others, such as Index and RangeIndex, can have their size modified. Therefore, the correct answer is "value, size".
6.
Point out the correct statement.
Correct Answer
D. All of the mentioned
Explanation
The correct statement is "All of the mentioned". This means that all the statements mentioned in the question are true. Pandas indeed consist of a set of labeled array data structures, an integrated group by engine for aggregating and transforming data sets, and moving window statistics.
7.
Which of the following statement will import pandas?
Correct Answer
A. Import pandas as pd
Explanation
The correct answer is "import pandas as pd" because this statement imports the pandas library and assigns it the alias "pd". This allows us to use the functions and methods provided by pandas in our code by using the "pd" prefix. The other options are incorrect because they either have a typo ("panda" instead of "pandas") or use a different alias ("py" instead of "pd").
8.
Point out the wrong statement.
Correct Answer
C. Panel is generally 2D labeled, also size-mutable array.
Explanation
The given answer is correct. The statement "Panel is generally 2D labeled, also size-mutable array" is incorrect. Panel is a data structure in pandas that was deprecated in version 0.20.0 and removed in version 0.25.0. It was a 3D labeled data structure with heterogeneous data types. Therefore, the correct statement is "None of the mentioned."
9.
Which of the following library is similar to Pandas?
Correct Answer
A. NumPy
Explanation
NumPy is similar to Pandas because both libraries are widely used in data analysis and manipulation. They provide efficient data structures and functions for handling large datasets, performing mathematical operations, and working with multi-dimensional arrays. While Pandas focuses more on providing high-level data manipulation tools and data analysis capabilities, NumPy is primarily focused on numerical computing and provides a foundation for many other scientific computing libraries. Therefore, NumPy is the most similar library to Pandas among the options given.
10.
Which of the following is used for testing for membership in the list of column names?
Correct Answer
A. In
Explanation
The keyword "in" is used for testing membership in Python. In this context, it can be used to check if a given item is present in a list of column names.