Cheatography
https://cheatography.com
class 12th ncert informatics practices chapter pandas "SERIES" in depth notes
This is a draft cheat sheet. It is a work in progress and is not finished yet.
Pandas
Data structures refer to specialized way of storing data so as to apply a specific type of functionality on them.
Pandas has three data structures.
1. Series
2. DataFrame
3. Panel |
|
What are series?
Series is an important data structure of pandas.
1. A series is an one dimensional array containing a sequence of values of any data type (int, float, list, string etc.)
2. The data label associated with a particular value is called its index.
3. Default index always starts from zero, we can also assign our own user defined indexes which can be of any data type. |
|
Creation of series
1.
import pandas as pd
s1=pd.Series([56,72,93,95])
print (s1)
OUTPUT
0 56
1 72
2 93
3 95
2.
import pandas as pd
s1=pd.Series([56,72,93,95]), index=['a','b','c','d']
print(s1)
|
• always put "import pandas as pd" before every command.
• when no index is specified, default index is applied.
• The "S" in Series has to always be in capital
|
|
|
|
|