Informatics Practices
Give the output:
import pandas as pd
name = ['Rahul','Aman','Karan']
p=pd.Series (name, index= [0,1,2] )
p1 = p.reindex ([1,2,3])
print(p)
print(p1)
Python Pandas
1 Like
Answer
0 Rahul
1 Aman
2 Karan
dtype: object
1 Aman
2 Karan
3 NaN
dtype: object
Working
The provided Python code utilizes Pandas to create a Series p using the list name with indices [0, 1, 2]. Subsequently, p is reindexed using p.reindex([1, 2, 3]), creating a new Series p1. The output displays both p and p1.
Answered By
3 Likes
Related Questions
Ms. Samantha has many electronic gadgets which are not usable due to outdated hardware and software. Help her to find the three best ways to dispose of the used electronic gadgets.
What do you understand about Netiquette? Explain any two such etiquette.
What is Mathematical function in SQL? Name any two.
Mr. Sombuddha, an HR Manager in a multinational company "Star-X World", has created the following table to store the records of employees:
Table: Emp
Eid EName Department DOB DOJ Star1 Dev Sales 1994-08-28 2020-02-14 Star2 Melinda IT 1997-10-15 2021-11-19 Star3 Raj Accounts 1998-10-02 2019-04-02 Star4 Michael Sales 2000-02-17 2020-05-01 Star5 Sajal IT 2001-12-05 2018-06-13 Star6 John Accounts 1995-01-03 2019-07-15 Star7 Julia Sales 1985-11-13 2020-08-19 Predict the output of the following queries that he has written:
(i) Select max(year(DOB)) from emp;
(ii) Select ENAME from emp where month(DOJ) = 11;
(iii) Select length(EName) from emp where Department = "IT";