#problem Statement
*Create a Data frame (name as "original_df") using these values*
column name :- [name, age, mobile number, id, gmail, address]
values : name :- ['vikas', ravtej, uday, vivek, suresh, gnenader]
age :- ['24', '24', '24', '23', '30', '25']
mobile number :-['7839550000', '7839550001', '7839550002', '7839550003', '7839550004', '7839550005']
id :- ['ctpl0', 'ctpl1', 'ctpl2', 'ctpl3', 'ctpl4', 'ctpl5']
gmail :- ['v7839550000@ct.com', 'r7839550001@ct.com', 'u7839550002@ct.com', 'v7839550003@ct.com', 's7839550004@ct.com', 'g7839550009@ct.com']
address :- ['noida', 'noida', 'noida', 'delhi', 'hyderabad', 'hyderabad']
1. Create a new 'df_1' by Filter out "age" column by "24", and print the df_1 (make sure "original_df" remains unchanged).
2. Print "original_df".
3. verify that "id" column has value as "alphanumeric" (using "original_df").
4. Verify that "mobile number" column value is present in corresponding row in "gmail" column , if not then return corresponding "id" value.
5. verify that if "age" column has value as "24" then "address" column has value as "noida", if condition is True return "pass", else return "fail"
I Have done half of the code, i got strucked in 3 ponit.
Kindly Help me on this.
# Code
import pandas as pd
# Creating the dataframe
def fun_1():
original_df = pd.DataFrame(
{'name': ['vikas', 'ravtej', 'uday', 'vivek', 'suresh', 'gnenader'], 'age': ['24', '24', '24', '23', '30', '25'],
'mobile_number': ['7839550000', '7839550001', '7839550002', '7839550003', '7839550004', '7839550005'],
'id': ['ctpl0', 'ctpl1', 'ctpl2', 'ctpl3', 'ctpl4', 'ctpl5'],
'gmail': ['v7839550000@ct.com', 'r7839550001@ct.com', 'u7839550002@ct.com', 'v7839550003@ct.com',
's7839550004@ct.com', 'g7839550009@ct.com'],
'address': ['noida', 'noida', 'noida', 'delhi', 'hyderabad', 'hyderabad']})
return original_df
# creating new dataframe
def fun_2(df):
df_1 = df.loc[df['age'] == '24']
return df_1
#verify that "id" column has value as "alphanumeric" (using "original_df")
def fun_3():
check_point = 'pass'
id = ['ctpl0', 'ctpl1', 'ctpl2', 'ctpl3', 'ctpl4', 'ctpl5']
for alphanumeric in id:
if alphanumeric == 'ctpl0':
pass
else:
check_point = 'fail'
print(check_point)
return check_point
if __name__ == '__main__':
rs1 = fun_1()
print(rs1)
print('******************************************')
rs2 = fun_2(rs1)
print(rs2)
print('******************************************')
print(rs1)
print('******************************************')
rs3 = fun_3()
print(rs3)
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme