CBSE Class 12 Informatics Practices
Question 23 of 40
Practice Paper — Question 5
Back to all questions0 -10
1 -20
2 -30
3 -10
4 -20
5 -30
dtype: int64
The above code imports the pandas library and assigns it the alias pd. Then, it defines a Python list named list1. The (list1 * 2) expression repeats the list list1 twice. In Python, when we multiply a list by an integer, it creates a new list that contains the original list repeated that number of times. Finally, a Pandas Series object named ser is created from this new list, and the Series ser is printed.