Path: blob/master/Generative AI for Intelligent Data Handling/Day1 part 2 Data Manipulation using Pandas.ipynb
3074 views
Kernel: Python 3 (ipykernel)
Data Manipulation using Pandas
Series: 1D () , 1,2,3
DataFrame: 2D(), R*C [[1,2]],[[2,2]]
Panels: 3D(), ARC , [[[1,2]],[[3,2,]],[[2,3]]
In [5]:
Out[5]:
1
In [9]:
Out[9]:
one 1
two 2
three 3
dtype: int64
In [13]:
Out[13]:
1 Red
2 Pink
dtype: object
In [14]:
Out[14]:
In [15]:
Out[15]:
In [16]:
Out[16]:
In [17]:
Out[17]:
1.Rows from top
In [18]:
Out[18]:
Rows from bottom
In [19]:
Out[19]:
3. Info of DataFrame 1:
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 5 entries, 0 to 4
Data columns (total 3 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 Name 5 non-null object
1 Age 5 non-null int64
2 Department 5 non-null object
dtypes: int64(1), object(2)
memory usage: 248.0+ bytes
In [20]:
Out[20]:
In [25]:
Out[25]:
In [24]:
Out[24]:
4. Description of DataFrame 2:
In [27]:
Out[27]:
5. Shape of DataFrame 1:
(5, 3)
In [28]:
Out[28]:
6. Columns of DataFrame 2:
Index(['Name', 'Salary', 'Experience'], dtype='object')
In [29]:
Out[29]:
In [35]:
Out[35]:
pandas.core.series.Series
In [36]:
Out[36]:
8. Selecting row labeled 'Bob' in DataFrame 2:
Name Salary Experience
2 Bob 55000 8
In [37]:
Out[37]:
9. Dropping 'Department' column from DataFrame 1:
Name Age
0 John 25
1 Alice 30
2 Bob 35
3 Emma 28
4 Ashi 32
In [38]:
Out[38]:
In [39]:
Out[39]:
In [56]:
Out[56]:
In [57]:
Out[57]:
Name 0
Age 0
Salary 1
Experience 1
dtype: int64
In [60]:
In [62]:
Out[62]:
10. Filling missing values in DataFrame 2 with 0:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
Partcipants with Age Greater than 30
In [ ]:
In [ ]:
In [ ]: