Question
Operations on pandas 1.make a pandas Data Frame having the following structure: float_col int_col str_col 0 0.1 1 a 1 0.2 2 b 2 0.2
Operations on pandas
1.make a pandas Data Frame having the following structure:
float_col int_col str_col
0 0.1 1 a
1 0.2 2 b
2 0.2 6 None
3 10.1 8 c
4 NaN -1 a
2.Filter the columns float_col and int_col from the Data Frame in one query.
Hint:use ix method of Data Frames.Print without using ix method.
3.Filter the records from float_col having a value greater than 0.15 and in a separate query,filter float_col value equal to 0.1
4 . Filter the records from the Data Frame which satisfies both the conditions float_col greater than 0.1 and int_col greater than 2.
5. Filter the records from the Data Frame which satisfies the conditions float_col not greater than 0.1.
6.make a new Data Frame where column int_col is renamed to a new name.
7.Modify the existing Data Frame and rename the column int_col to a new name.
8.Drop the rows where values are missing from the Data Frame.
9.Change the missing value in column float_col as the mean value of the float_col
10.Change all the values of str_col with a new value a drop the missing values. The New value should have the prefix map_and original value.For example,map_a, map_b.
11.Group all the values of str_co land find the mean off loat_colin all the groups,respectively.
12.Find the covariance off lo at_col and int_col
13.Find the correlation off lo at_col and int_col.
14.make a Data Frame other having columns some_val and str_col with the given values:
some_val str_col
0 1 a
1 2 b
Perform inner join, outer join, left join,and right join with the Data Frame x.
15.When the same invitations are sentto many people, the body of the mail does not change. Only the name (and maybe address) needs to be changed.
Mail merge is a process of doing this. Instead of writing each mail separately,we
can have a template for the body of the mail and a list of names that can be merged.
make a text file "names.txt" having the names:
Anil
sunita
Suman
Lokesh
Sumita
John
Johny
make a text file "body.txt" having the body of the email as written below:
I am going to Delhi. Let's meet on 7th Jan 2018
Have a great day
Regards
Team Victory
make a program to create separate file as Anil.txt, Sunita.txt, Suman.txt, etc.After
picking names from names.txt. content of these files looks like the following:
Anil.txt
-----------------------
Hello Anil
I am going to Delhi. Let's meet on 7th Jan 2018
Have a great day
Regards
Team Victory
------------------------
Sunita.txt
-----------------------
Hello Sunita
I am going to Delhi. Let's meet on 7th Jan 2018
Have a great day
Regards
Team Victory
------------------------
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started