Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Attempted: 1/2 Tension Analysis PYTHON2 Compiler: Python 2.7 1 2 Nmst in 3 4 You are working on a project in which you need to
Attempted: 1/2 Tension Analysis PYTHON2 Compiler: Python 2.7 1 2 Nmst in 3 4 You are working on a project in which you need to analyze the amount of tension that exists among a group of individuals. The dataset you are provided with is in the form of a CSV file and contains three columns namely: Age. Category and Tension. The URL of the CSV file is passed to your function as a parameter named input1 and has already been loaded on the console and stored as a data frame under the variable name data_frame for your reference Below given a snippet of the data in date_frame import pandas as pd # Read only region start class Result(object): def init__(self, argi, arg2): self.output1=argi # List[Double] self.output2=arg2 # List[Double] class UserMainCode(object): @classmethod def Tension_Analysis(cls, input1): on a caso $ inputi : string 12 Category Tension Age 26 Expected return type : Result RE 30 L 15 data_frame = pd.read_csv(input1). A # DASAR1. Dean and L 54 25 L 70 A [ Use Custom Input You must calculate the following from the dataset: mpted: 1/2 PYTHON2 Compiler: Python 2.7 1 1. Mean Age value for the three levels of Tension rounded off to two decimal places i.e. mean Age value for each of H, L and M respectively. Store these values in the same order in a list named data 1. import pandas as pd # Read only region start class Result(object): def _init__(self, argi, arg2): self.output1=argi # List[Double self.output2=arg2 # List[Double class UserMainCode(object): @classmethod def Tension_Analysis(cls, input1): 2. Mean Age value for the two Category values rounded off to two decimal places i.e., mean Age value for each of A and B. Store these values in the same order in a list named data_2. nm in o o o og 1 10 inputi : string Your task is to return the lists lie data_1 & data_2 in the form of a Result (data_1, data_2) object Expected return type : Result 14 Input Specification: data frame pd.read_csv(input1) + Did not in and input1 : A string denoting the URL of the dataset. Output Specification: Use Custom Input Output1: A List (data 1) denoting the Mean age value for the
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