Lesson 10, Topic 2
In Progress

Topic 12.2: Data structures

Lesson Progress
0% Complete

 Pandas provides two very useful data structures to process the data.

1.)Series

2)DataFrame

Series

  1. Series The Series is a one-dimensional array that can store various data types, including mix data types. The row labels in a Series are called the index.
  2.  Any list, tuple and dictionary can be converted in to Series using ’series’ method as shown below

Import padas as pd

dt=[10,20,30,40]

type(dt)

obj1=pd.Series(dt)

obj1

dt1=(‘smita’,’Python’ , ’be’ , ‘2022’)

type(dt1)

obj2=pd.Series(dt1)

obj2

dt2=(‘smita’,’Python’ , ’be’ , ‘2022’)

type(dt2)

obj3=pd.Series(dt2)

obj3

dt3={‘name’ :‘smita’,’course’:’Python’ ,’EC’: ’be’ ,’Ac_Yr’: ‘2022’}

type(dt3)

obj4=pd.Series(dt3)

obj4

l=[‘smita’,’21-feb-2022’,78]

l=pd.Series(l,index=[‘name’,’Dob’,’score’]

l

l[‘name’]

l[‘Dob’] l[‘score’]

This website uses cookies to ensure you get the best experience on our website.