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
What is the meaning of Re:?
adelina 88 [10]

Answer:

In Email's Subject Line “Re:” most commonly understood as “Reply/Response” to an Email. “Re: ” is not taken as abbreviation of Regards/Reference. For Reference, Abbreviation is “Ref.”Explanation:

5 0
2 years ago
Read 2 more answers
Complete the body of the decrement static method using only the NaturalNumberKernel methods (multiplyBy10, divideBy10, and isZer
Ivan

Answer:true

Explanation:mark as brainliest

6 0
3 years ago
What should every Software Engineer know about Software Architecture?
Alenkinab [10]
<span>!UML (all of them)
2.Flowchart (more for understanding a real world process of some kind; like a business process)
3.Data model including Bachman (if you don't need to at least understand your data, how it is stored versus a model, i.e., Bachman then you are doing it wrong and your schema could be simplistic)
This is 3 different examples</span>
6 0
3 years ago
1.<br> The correct way to use a seat belt is
Nesterboy [21]

Answer:

4 steps

Explanation:

Step 1: Pull belt across body

Sit in any of your vehicle's seats and secure the three-point harness in its buckle by pulling it across your body.

If the seatbelt is too short, consider an aftermarket restraint and extender. Make sure they meet federal safety standards and are installed professionally.

Step 2: Adjust lower belt

Adjust the lower belt snuggly across your lap and pelvis area – never your stomach.

Pregnant women should wear the lap belt below their belly, not on or above it.

Step 3: Adjust shoulder belt

Adjust the shoulder belt to fit comfortably across the collarbone and chest. It should never rub on your neck or face. Never put the shoulder belt behind your back or under your arm.

Step 4: Check before driving

Check that the belt is secure before driving.

4 0
2 years ago
What is the name and purpose of the star next to a slide in a PowerPoint presentation?
Finger [1]
If you observe closely, you may see that these stars are shown only against some slides and not all of them.

The stars are just an indication that the particular slide has custom animation. That was you can quickly see at a glance if a slide has content that is animated.

The same star symbol is also shown when the slide itself has any slide transition set.
7 0
2 years ago
Other questions:
  • HELP I don't understand this
    14·2 answers
  • A food web is shown below. In this food web, energy is transferred directly from the to the
    11·1 answer
  • A computer is made of up 6 main components: a) CPU (central processing unit)
    7·1 answer
  • Write a program that utilizes the concept of conditional execution, takes a string as input, and: prints the sentence "Yes - Spa
    8·1 answer
  • What is the voltage drop across R4 in the diagram shown above?
    13·1 answer
  • Stuart wants to delete some text from a slide. What should Stuart do?A. From the Review tab, choose Highlight text and then pres
    7·2 answers
  • A company has critical systems that are hosted on an end-of-life OS. To maintain operations and mitigate potential vulnerabiliti
    14·1 answer
  • Examples of analog computer
    8·1 answer
  • Question 3 10 points Save Answer Many companies in the computer industry introduce new products and services frequently in an at
    7·1 answer
  • What is 2+2 I need to know hurry
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!