Document (4)-1
Document (4)-1
Output:-
0 9
1 8
2 7
3 6
4 5
5 4
6 3
dtype: int64
Output:-
A 500
B 1000
C 1500
dtype: int64
#2 Given a Series, print all the elements that are above the 75th
percentile.
Output:-
0 1
1 3
2 4
3 7
4 8
5 8
6 9
dtype: int64
Output:-
Original DataFrame:
Category Item Name Expenditure
0 Electronics Laptop 1000
1 Fashion Shirt 50
2 Electronics Tablet 500
3 Fashion Shoes 100
4 HomeGoods Chair 200
Output:-
Count 7.00
Mean 18450.00
Std 28543.61
Min 500.00
25% 1575.00
50% 2500.00
75% 29000.00
Max 65000.00
Name: Price, dtype: float64
#5. Create a data frame for examination result and display row labels, column
labels data types of each column and the dimensions.
Output:-
Class Pass-Percentage
0 I 100.0
1 II 100.0
2 III 100.0
3 IV 100.0
4 V 100.0
5 VI 100.0
6 VII 100.0
7 VIII 100.0
8 IX 100.0
9 X 98.6
10 XI 100.0
11 XII 99.0
Class object
Pass-Percentage float64
dtype: object
Shape of the dataframe is:::::
(12, 2)
#6. Filter out rows based on different criteria such as duplicate rows.
Output:-
Name MarksinIP
0 Rohit 85
2 Deepak 92
3 Rohit 85
4 Deepak 92
#7. Find the sum of each column, or find the column with the lowest mean.
Output:-
Output:-
Name MarksinIP
4 Pankaj 98
5 Sohit 96
2 Deepak 92
#9. Subtract the mean of a row from each element of the row in a Data Frame.
Output:-
Output:-
Data1 Data2
0 -5 2
1 -2 4
2 5 10
3 8 15
4 9 -5
5 -6 -8
Output:-
Output:
Name Age
0 John 25
1 Mary 31
#13 HANDLING DATE AND TIME DATA USING PANDAS.
Output:-
Date sales
2024-01-01 200
2024-02-01 250
2024-03-01 300
#15 MERGING TWO PROVIDED DATAFRAMES IN A SINGLE DATAFRAME USING
PANDAS.
Output:-
Merged DataFrame:
ID Name Salary
0 1 Alice 50000
1 2 Bob 60000
2 3 Charlie 45000
#14 GROUPING THE PROVIDED DATA USING PANDAS.
Output:-