English

Kavyanjali, a chemical analyst, needs to arrange data of few elements in the form of two series containing symbols and their atomic numbers respectively. Thereafter, the data of these two series - Informatics Practices

Advertisements
Advertisements

Question

Kavyanjali, a chemical analyst, needs to arrange data of few elements in the form of two series containing symbols and their atomic numbers respectively. Thereafter, the data of these two series has to be arranged and displayed in the form of Data Frame as shown below:

  Symbol Atomic Number
Hydrogen H 1
Helium He 2
Lithium Li 3
Beryllium Be 4

Help her in writing suitable Python code to complete the task.

Code Writing

Solution

d = {'Symbol':pd.Series(['H','He','Li','Be'],['Hydrogen','Helium','Lithium','Beryllium']),
'Atomic No': pd.Series([1,2,3,4],['Hydrogen','Helium','Lithium','Beryllium'])} 
df=pd.DataFrame(d)
shaalaa.com
  Is there an error in this question or solution?
2022-2023 (March) Set 4
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×