Informatics Practices
Complete the given Python code to get the required output (ignore the dtype attribute) as
Output:
Tamil Nadu Chennai
Uttar Pradesh Lucknow
Manipur Imphal
Code:
import _______ as pd
data = ['Chennai','_______','Imphal']
indx = ['Tamil Nadu','Uttar Pradesh','Manipur']
s = pd.Series(_______, indx)
print(_______)
Python Pandas
2 Likes
Answer
import pandas as pd
data = ['Chennai', 'Lucknow', 'Imphal']
indx = ['Tamil Nadu','Uttar Pradesh','Manipur']
s = pd.Series(data, indx)
print(s)
Answered By
2 Likes
Related Questions
Mention two health concerns associated with excessive use of Digital Devices.
Sneha is writing a Python program to create a DataFrame using a list of dictionaries. However, her code contains some mistakes. Identify the errors, rewrite the correct code, and underline the corrections made.
import Pandas as pd D1 = {'Name': 'Rakshit', 'Age': 25} D2 = {'Name': 'Paul', 'Age': 30} D3 = {'Name': 'Ayesha", 'Age': 28} data = [D1, D2, D3) df = pd.Dataframe(data) print(df)
Ayesha's family is replacing their old computer with a new one. They decide to throw the old computer in a nearby empty field/plot.
I. Explain any one potential environmental hazard associated with improper e-waste disposal.
II. Suggest one responsible way to Ayesha's family for proper disposal of their old computer.
III. Describe the importance of recycling in e-waste management.
Write a Python program to create the following DataFrame using a list of dictionaries.
No Product Price 0 Laptop 60000 1 Desktop 45000 2 Monitor 15000 3 Tablet 30000