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 file formats can you safely use in a video presentation
dlinn [17]

i use fat 86 try it ok

7 0
3 years ago
In a Windows environment, __________ is a powerful tool that enables security administrators to share user and group definitions
spayn [35]

Answer:

Active Directory

Explanation:

Active Directory (AD) is a Microsoft product that consists of several services that run on Windows Server to manage permissions and access to networked resources.

Active Directory categorizes objects by name and attributes. For example, the name of a user might include the name string, along with information associated with the user, such as passwords and Secure Shell (SSH) keys.

7 0
2 years ago
A company that manufactures machine parts order a new system that makes Products at ten times the speed of earlier machines. the
Semmy [17]
D i think hope this helps
7 0
3 years ago
Read 2 more answers
What is the main reason that IT managers believe the future IT career model will be diamond-shaped, with few entry-level IT jobs
Valentin [98]
<span>In which career field, would the Computing Technology Industry Association's CompTIA A+ certification be useful?</span>
4 0
3 years ago
A ________ allows users to add, remove, or edit its content.
Amanda [17]
Wiki is the correct answer
4 0
3 years ago
Read 2 more answers
Other questions:
  • What are five most important areas of the animal industry that involve science and technology?
    14·1 answer
  • Which cloud computing service model will enable an application developer to develop, manage, and test their applications without
    15·1 answer
  • How does computer network work in a paragraph
    12·1 answer
  • Is it possible to uninstall a program that's on your phone from computer?
    8·1 answer
  • Using computer software, compare the 2016 year-to-date sales through February to the 2017 year-to-date sales through February fo
    15·1 answer
  • With microprocessors, The integration of a whole _____ onto a single chip or on a few chips greatly reduced the cost of processi
    14·1 answer
  • Students who respond promptly to e-mails are following which netiquette rule?
    13·2 answers
  • Which is a benefit of using the paste link option?
    15·2 answers
  • What type of web provides a framework that allows data to be shared and reuse to deliver
    9·1 answer
  • Which code block is an example of a motion block in scratch?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!