1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
frozen [14]
3 years ago
9

Consider a DataFrame named df with columns named P2010, P2011, P2012, P2013, 2014 and P2015 containing float values. We want to

use the apply method to get a new DataFrame named result_df with a new column AVG. The AVG column should average the float values across P2010 to P2015. The apply method should also remove the 6 original columns (P2010 to P2015). For that, what should be the value of x and y in the given code?
frames = ['P2010', 'P2011', 'P2012', 'P2013', 'P2014', 'P2015']
df['AVG'] = df[frames ].apply(lambda z: np.mean(z), axis=x)
result_df df.drop(frames, axis=y)
a. x = 1 y = 0.
b. x = 1 y = 1.
c. x = 0 y = 1.
d. x = 0 y = 0.
Computers and Technology
1 answer:
My name is Ann [436]3 years ago
6 0

Answer:

x = 1 ; y = 1

Explanation:

The newly created AVG column will contain the mean value of all 6 columns(P2010, P2011, P2012, P2013, 2014 and P2015) this means that we are taking the mean across the columns as our AVG column have the same length as the initial lengtb of the data Frame as all a values in each index are averaged to create the new column. To achieve this the value 1 will be passed to the axis argument in the apply method.

To drop the previous 6 columns, we se the axis argument set to 1, this will delete the columns passed to the drop method.

Hence, both x and y values of the axis argument will take the value 1.

You might be interested in
Why is it important to write something in the subject line of emails?
marin [14]
So the person can know what you want and it helps keep better track of emails and subject matters
8 0
3 years ago
Read 2 more answers
What are the paragraph different formatting paragraph tools?draw its icon and state its function.
aliya0001 [1]

Theres Tab, And File


:)

7 0
3 years ago
Question #1
Veronika [31]

The correct evolution is the production era-selling era-marketing era-relationship era

Explanation:

Evolution of marketing is the systematic way in which the marketing industry developed and hence the various developments and the modifications are systematically defined in each of the era

There are four major stages of development the product life cycle, the introduction, the growth and the maturity and finally the decline of the product. Philip Kotler is the founder of this modern method of marketing

4 0
3 years ago
What term describes a small text file used by web browsers and servers to track web sessions?
Gennadij [26K]
This term is called a "Cookie". 
7 0
3 years ago
Can someone can help me am dont know how much RAM do i need. I use my pc for work and to watch yt vid. Thanks​
Vitek1552 [10]

Answer:

at least 2gb

Explanation:

6 0
3 years ago
Other questions:
  • What is the management part of a dashboard?
    10·1 answer
  • How can investors receive compounding returns
    13·1 answer
  • In the Remote Access Domain, if private data or confidential data is compromised remotely, you should set automatic blocking for
    5·1 answer
  • I WILL MARK THE BRAINIEST!!!!!!!!!!!!! 50 POINTS!!!!!!!
    5·2 answers
  • What is output by the following?<br><br>print (type("95"))
    13·1 answer
  • The sun produces energy by the process of nuclear: <br><br> A.fission <br> B.fusion
    7·2 answers
  • What are the characteristics of the sorting and grouping options in Outlook? Check all that apply. Columns can be sorted by clic
    15·2 answers
  • Write a logical expression using only and, or and not that is equivalent to the Exclusive NOR (XNOR) gate on 2 inputs, called in
    15·1 answer
  • A sensitive manufacturing facility has recently noticed an abnormal number of assembly-line robot failures. Upon intensive inves
    10·1 answer
  • Can anyone tell me about Microsoft some important features for partical
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!