Q.26 Which of the following is true?1. If data is an ndarray, index must be the same length as data.2. Series is a one-dimensional labelled array capable of holding any data type3. Both A and B4. None of the above
Question
Q.26 Which of the following is true?1. If data is an ndarray, index must be the same length as data.2. Series is a one-dimensional labelled array capable of holding any data type3. Both A and B4. None of the above
Solution
The correct answer is 3. Both A and B.
Explanation:
-
If data is an ndarray, index must be the same length as data. This is true because in pandas, the index of a Series or DataFrame must match the length of the data.
-
Series is a one-dimensional labelled array capable of holding any data type. This is also true. A Series in pandas is a one-dimensional object that can hold any data type such as integers, floats, and strings.
Therefore, both statements are correct.
Similar Questions
Which of the following data structures is not supported by Pandas?SeriesDataFrameArrayPanel
Which of the following statement is correct about an Array?a.Index is used to locate the elements.b.It can store the elements of same variable type.c.Array elements are stored at contiguous memory locations.d.It is a non-linear data structure
Which of the following statements is true about Series in pandas?
Which of the following statements is true about arrays in Python?
Which of the following statements about arrays in C is not true:Group of answer choicesThe first element in the array is at index 0An array can be of any type, including another arrayThe compiler will generate an error if access is made to values outside the defined index range of the arrayAn array can be used to store large quantities of dataAn array can be passed to a function and its elements modified from within the function
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.