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
A(n) _____ allows a user to choose specific files to back up, regardless of whether or not the files have been changed.
Anna35 [415]
<span>A selective backup allows a user to choose specific files to back up, regardless of whether or not the files have been changed.</span>
7 0
3 years ago
Omnvmjsjskskskajskskzksososjfnjcjckskqnd
yarga [219]

what is the meaning to this??

4 0
4 years ago
Anna is making a presentation on the solar system. She wants to emphasize the planet names as they appear one by one on the pres
Svetach [21]

slide transition effect.

5 0
3 years ago
11. How much time will you save on a
matrenka [14]

Answer:

Less than 1 min, so A.

Explanation:

Hope this helps!

( it really does help you save)

7 0
3 years ago
Whats in a computer?
kenny6666 [7]
A lot of things are in a computer there a motherboard, A cpu, A hard drive etc. A motherboard is the computer system  bascilly its the heart for a computer. The cpu is the the brain of a computer it controls on your computer and keeps it going good. finally a hard rive is the memory of your computer it stores all the data including files, photos, etc
8 0
4 years ago
Read 2 more answers
Other questions:
  • In 2007, __________ Floridians were injured in alcohol-related collisions.
    6·2 answers
  • How can I write an assignment statement that stores the character 'X' in a variable ch?
    6·1 answer
  • Refer to the image below. The letter item indicated at 3. is_____________________ a Your Address - Where you are b The Letter Ad
    7·1 answer
  • A contact list is a place where you can store a specific contact with other associated information such as a phone number, email
    8·1 answer
  • 16. Budget Analysis Write a program that asks the user to enter the amount that he or she has budgeted for a month. A loop shoul
    14·1 answer
  • Describe a common error that presenters make during their presentation and how to remedy the error​
    12·2 answers
  • What function will delete an element from the end of a deque. On Edge
    13·1 answer
  • Define file manager
    13·1 answer
  • We cannot imagine a life without the Internet. Imagine that you had to live without being connected to the Internet. Discuss the
    9·1 answer
  • Who are all the fnaf characters?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!