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.

Answers

Answer 1

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.


Related Questions

How to create a network of relevant prospects?

Answers

Answer:

By connecting with industry-specific and relevant prospects.

Now with 760 million+ people, how can you find the most relevant people to connect with? The answer is: With the help of LinkedIn automation tools.

There are a number of best LinkedIn automation tools that come with advanced search filters to help you refine your target audience. These LinkedIn automation tools have special operators that help users find and reach even the most difficult leads.

However, there is a drawback. These LinkedIn automation tools can cause spam if you send thousands of connection requests or messages in a short time.

Moreover, if you send templated connect notes or messages, you’re likely to get a very low or almost zero acceptance and response rate.

a. Download the attached �Greetings.java� file.
b. Implement the �getGreetings� method, so that the code prompts the user to enter the first name, the last name, and year of birth, then it returns a greetings message in proper format (see the example below). The �main� method will then print it out. Here is an example dialogue with the user:
Please enter your first name: tom
Please enter your last name: cruise
Please enter your year of birth: 1962
Greetings, T. Cruise! You are about 50 years old.
Note that the greetings message need to be in the exact format as shown above (for example, use the initial of the first name and the first letter of the last name with capitalization).
c. Submit the final �Greetings.java� file (DO NOT change the file name) online.

Answers

Answer:

Code:

import java.util.*;  

public class Greetings  

{  

   public static void main(String[] args)  

   {        

       Scanner s = new Scanner(System.in);  

       System.out.println(getGreetings(s));  

   }  

   private static String getGreetings(Scanner console)  

   {          

   System.out.print("Please enter your first name: ");  

   String firstName=console.next();    

   char firstChar=firstName.toUpperCase().charAt(0);  

   System.out.print("Please enter your last name: ");  

   String lastName=console.next();    

   lastName=lastName.toUpperCase().charAt(0)+lastName.substring(1, lastName.length());  

   System.out.print("Please enter your year of birth: ");  

   int year=console.nextInt();  

   int age=getCurrentYear()-year;  

   return "Greetings, "+firstChar+". "+lastName+"! You are about "+age+" years old.";  

   }  

   private static int getCurrentYear()  

   {  

       return Calendar.getInstance().get(Calendar.YEAR);  

   }  

}

Output:-

what is the build in libary function to compare two strings?​

Answers

Answer:

strcmp() is a built-in library function and is declared in <string. h> header file. This function takes two strings as arguments and compare these two strings lexicographically.

Explanation:

Hope it helps

how did hitles rules in nazi germany exemplify totiltarian rule?

Answers

Answer:

hope this helps if not srry

Write a C program that will load entries from a file containing details of books and prints them.

Program Requirements:
a. Load file containing details of books
b. Print out all the books Required approach:

1. Design a struct/class that can hold the details of an individual book.
2. Dynamically allocate an array of these objects. The size should be the number of book entries from the input file given by the user.
3. Load all of the book entries into this array of objects before printing

Answers

Answer:

........

Explanation:

Write a program that produces the following output:CCCCCCCCC CC CC CC CC CCCCCCCCC Note: The letter C in the output must be uppercas

Answers

Answer:

CCCCCCCCC ++ ++ CC ++ ++ CC ++++++++++++++ +++++++++++++++ CC ++++++++++++++ +++++++++++++++ CC ++ ++ CCCCCCCCC ++ ++

Note: The letter C in the output must be uppercase.

#include <iostream>

using namespace std;

int main()

{

  cout<<"CCCCCCCCC ++ ++ CC ++ ++ CC ++++++++++++++ +++++++++++++++ CC +++++++++++++\n";

  cout<<"+++++++++++++++ CC ++ ++ CCCCCCCCC ++ ++";

 

  return 0;

}

 

How many cost units are spent in the entire process of performing 40 consecutive append operations on an empty array which starts out at capacity 5, assuming that the array will grow by a constant 2 spaces each time a new item is added to an already full dynamic array

Answers

Answer:

Explanation:

260 cost units, Big O(n) complexity for a push

Consider an Erlang loss system. The average processing time is 3 minutes. The average inter-arrival time is 3 minutes. The number of servers is 3. What is r (sometimes referred to as the offered load)

Answers

Answer:

r = 1

Explanation:

Average processing time ( p ) = 3 minutes

Average inter-arrival time ( a ) = 3 minutes

number of servers ( m ) = 3

Determine the value of r

r ( offered load ) = p/a

                          = 3 / 3  = 1

∴ value of r ( offered load ) = 1

write a programmimg code in c++ for school based grading system, the program should accept the subject in the number of students from a user and store their details in the array of type student(class) the student class you have:
1. number student name, index number remarks as variables of type string, marks as integer and grade as char.
2. avoid function called getData which is used to get student details
3. avoid function called calculate which will work on the marks and give the corresponding great and remarks as given below on
Marks 70-100 grade A remarks excellent Mark 60-69 Grade B remarks very good marks 50-59 grade C remarks pass maths 0-49 grade F remarks fail​

Answers

Answer:

The program is as follows:

#include <iostream>

#include <string>

using namespace std;

class Student{

string studName, indexNo, remarks; int marks;  char grade;

public:

 void getData(){

     cin.ignore();

     cout<<"ID: "; getline(cin,indexNo);

  cout<<"Name:"; getline(cin,studName);

  cout<<"Marks: ";cin>>marks;  }

 void calculate(){

  if(marks>=70 && marks<=100){

      remarks ="Excellent";       grade = 'A';   }

  else if(marks>=60 && marks<=69){

      remarks ="Very Good";       grade = 'B';   }

  else if(marks>=50 && marks<=59){

      remarks ="Pass";       grade = 'D';   }

  else{

      remarks ="Fail";       grade = 'F';   }

  cout << "Grade : " << grade << endl;

  cout << "Remark : " << remarks << endl;  }

};

int main(){

int numStudents;

cout<<"Number of students: "; cin>>numStudents;

Student students[numStudents];

for( int i=0; i<numStudents; i++ ) {

 cout << "Student " << i + 1 << endl;

 students[i].getData();

 students[i].calculate(); }

return 0;}

Explanation:

This defines the student class

class Student{

This declares all variables

string studName, indexNo, remarks; int marks;  char grade;

This declares function getData()

public:

 void getData(){

     cin.ignore();

Prompt and get input for indexNo

     cout<<"ID: "; getline(cin,indexNo);

Prompt and get input for studName

  cout<<"Name:"; getline(cin,studName);

Prompt and get input for marks

  cout<<"Marks: ";cin>>marks;  }

This declares funcion calculate()

 void calculate(){

The following if conditions determine the remark and grade, respectively

  if(marks>=70 && marks<=100){

      remarks ="Excellent";       grade = 'A';   }

  else if(marks>=60 && marks<=69){

      remarks ="Very Good";       grade = 'B';   }

  else if(marks>=50 && marks<=59){

      remarks ="Pass";       grade = 'D';   }

  else{

      remarks ="Fail";       grade = 'F';   }

This prints the grade

  cout << "Grade : " << grade << endl;

This prints the remark

  cout << "Remark : " << remarks << endl;  }

};

The main begins here

int main(){

This declares number of students as integer

int numStudents;

Prompt and get input for number of students

cout<<"Number of students: "; cin>>numStudents;

This calls the student object to declare array students

Student students[numStudents];

This is repeated for all students

for( int i=0; i<numStudents; i++ ) {

Print number

 cout << "Student " << i + 1 << endl;

Call function to get data

 students[i].getData();

Call function to calculate

 students[i].calculate(); }

return 0;}

Write a program that creates an an array large enough to hold 200 test scores between 55 and 99. Use a Random Number to populate the array.Then do the following:1) Sort scores in ascending order.2) List your scores in rows of ten(10) values.3) Calculate the Mean for the distribution.4) Calculate the Variance for the distribution.5) Calculate the Median for the distribution.

Answers

Answer:

Explanation:

The following code is written in Python. It uses the numpy import to calculate all of the necessary values as requested in the question and the random import to generate random test scores. Once the array is populated using a for loop with random integers, the array is sorted and the Mean, Variance, and Median are calculated. Finally The sorted array is printed along with all the calculations. The program has been tested and the output can be seen below.

from random import randint

import numpy as np

test_scores = []

for x in range(200):

   test_scores.append(randint(55, 99))

sorted_test_scores = sorted(test_scores)

count = 0

print("Scores in Rows of 10: ", end="\n")

for score in sorted_test_scores:

   if count < 10:

       print(str(score), end= " ")

       count += 1

   else:

       print('\n' + str(score), end= " ")

       count = 1

mean = np.mean(sorted_test_scores)

variance = np.var(sorted_test_scores, dtype = np.float64)

median = np.median(sorted_test_scores)

print("\n")

print("Mean: " + str(mean), end="\n")

print("Variance: " + str(variance), end="\n")

print("Median: " + str(median), end="\n")

Which statement is trueBlockchain is often associated with Bitcoin and the financial services industry. However, it is applicable to almost every industry. The term Multi-party Systems better describes how the blockchain system is used.

What is a benefit of a Multi-party System? about blockchain?

Answers

Blockchain is sometimes refers to original Bitcoin blockchain.

Answer :

Blockchain  is defined as the database system which maintains and also records the data in various ways  which allows the multiple organizations.

Blockchain and multiparty systems specializes in the supply chain or digital identity and also financial services.

A multi-party system prevents leadership of the single party from the controlling a single legislative chamber without any challenge.

Learn more  :

https://brainly.in/question/43683479

A computer has many resources. A resource can be memory, disk drive, network bandwidth, battery power, or a monitor. It can also be system objects such as shared memory or a linked list data structure. This principle is based in object-oriented programming (OOP). In OOP, a class definition encapsulates all data and functions to operate on the data. The only way to access a resource is through the provided interface. Which security principle are we referring to

Answers

Answer:

The security principle being referred to here is:

Resource Encapsulation.

Explanation:

Resource Encapsulation is one of the cybersecurity first principles.  It allows access or manipulation of the class data as intended by the designer. The cybersecurity first principles are the basic or foundational propositions that define the qualities of a system that can contribute to cybersecurity.  Other cybersecurity first principles, which are applied during system design, include domain separation, process isolation, modularization, abstraction, least principle, layering, data hiding, simplicity, and minimization.

transmits data wirelessly via infrared (IR) light waves.
As
O A. RFID
B. Ethernet
O C. Bluetooth
D. IrDA
Reset Selection

Answers

Answer is
C - Bluetooth ( wireless via infrared )

Define a class named Payment that contains an instance variable of type double that stores the amount of the payment and appropriate get and set methods. Also, create a method named paymentDetails that outputs an English sentence to describe the payment amount. Next, define a class named CashPayment that is derived from Payment. This class should redefine the paymentDetails method to indicate that the payment is in cash. Include appropriate constructor(s). Define a class named CreditCardPayment that is derived from Payment. This class should contain instance variables for the name on the card, expiration date, and credit card number. Include appropriate constructor(s). Finally, redefine the paymentDetails method to include all credit card information. Define a class named PaymentTest class that contains the main() method that creates two CashPayment and two CreditCardPayment objects with different values and calls paymentDetails for each. (5 pts)

Answers

Answer:

The code is given below:

class Payment

{

private double amount;  

public Payment( )          

{

   amount = 0;

}

public Payment(double amount)

{

  this.amount = amount;

}

public void setPayment(double amount)

{

    this.amount = amount;

}

public double getPayment( )

{

   return amount;

 }

public void paymentDetails( )

{

   System.out.println("The payment amount is " + amount);

}

}

class CashPayment extends Payment

{

       public CashPayment( )

       {

             super( );

       }

      public CashPayment(double amt)

     {

      super(amt);

      }

     public void paymentDetails( )

    {

     System.out.println("The cash payment amount is "+ getPayment( ));

     }

}

class CreditCardPayment extends Payment

{

       private String name;

       private String expiration;

       private String creditcard;

       public CreditCardPayment()

      {

             super( );

            name = " ";

             expiration = " ";

              creditcard = "";

      }

       public CreditCardPayment(double amt, String name, String expiration, String creditcard)

      {

             super(amt);

             this.name = name;

             this.expiration = expiration;

             this.creditcard = creditcard;

      }

         public void paymentDetails( )

        {

           System.out.println("The credit card payment amount is " + getPayment( ));

           System.out.println("The name on the card is: " + name);

           System.out.println("The expiration date is: " + expiration);

           System.out.println("The credit card number is: " + creditcard);

      }

}

class Question1Payment

{

      public static void main(String[ ] args)

       {

         CashPayment cash1 = new CashPayment(50.5), cash2 = new CashPayment(20.45);

         CreditCardPayment credit1 = new CreditCardPayment(10.5, "Fred", "10/5/2010",

                                                                                                "123456789");

         CreditCardPayment credit2 = new CreditCardPayment(100, "Barney", "11/15/2009",

                                                                                                 "987654321");

         System.out.println("Cash 1 details:");

         cash1.paymentDetails( );

         System.out.println( );

         System.out.println("Cash 2 details:");

         cash2.paymentDetails( );

          System.out.println( );

         System.out.println("Credit 1 details:");

         credit1.paymentDetails( );

         System.out.println( );

         System.out.println("Credit 2 details:");

         credit2.paymentDetails( );

         System.out.println( );

       }

}

Output:

Programming languages categorize data into different types. Identify the characteristics that match each of the following data types.

a. Can store fractions and numbers with decimal positions
b. Is limited to values that are either true or false (represented internally as one and zero).
c. Is limited to whole numbers (counting numbers 1, 2, 3, ...)

Answers

Answer:

a) Integer data type.

b) Real data type.

c) Boolean data type.

Explanation:

a) Integer data type is limited to whole numbers (counting numbers 1, 2, 3…….).

b) Real data type can store fractions and numbers with decimal positions (such as dollar values like $10.95).

c) Boolean data type is limited to values that are either true or false (represented internally as 1 and 0 respectively).

An integer is said to be a perfect number if the sum of its divisors, including 1 (but not the number itself), is equal to the number.

a. True
b. False

Answers

true

explanation: bc it is

What is the easiest way to deploy a C++ program to a user’s computer? a. Copy the source code to the user’s computer and then compile it b. Create a batch file that copies the program to the user’s computer and then run it c. Copy the executable file to the user’s computer d. Create an installer program and then run it on the user’s computer

Answers

Answer:

c. Copy the executable file to the user’s computer

Explanation:

When you run a c++ program, an executable file (.exe) is created in the same directory with the source file.

To deploy this program on another system, you need to transfer the executable file from the original system where the program was executed to the new system.

The program will work fine without errors.

However, do not mistake the executable file for the source file. The source file ends in .cpp.

Which option is used in order to configure switchboards for a complex database?
Switchboard Manager
Global Options
Quick Search
Database Formatter
worth 100 points

Answers

Answer:

switch board manager

Explanation:

Which Windows installation method requires the use of Windows deployment services (WDS)?
1. Network Installation
2. Repair Installation
3. Bootable flash drive installation
4. Unattended installation​

Answers

Answer:

1. Network Installation

Explanation:

Given

Options (1) to (4)

Required

Which requires WDS for installation

WDS are used for remote installations where users do not have to be physically present before installations can be done; in other words, it is necessary for network based installations.

Of all the given options, (a) is correct because without WDS, network installation cannot be done.

The Federal Financial Institutions Examination Council (FFIEC) developed the Cybersecurity Assessment Tool, which can be used as a self-assessment tool for identifying a bank or financial institution's cybersecurity maturity.
a. True
b. False

Answers

Answer:

a. True

Explanation:

Cyber security can be defined as preventive practice of protecting computers, software programs, electronic devices, networks, servers and data from potential theft, attack, damage, or unauthorized access by using a body of technology, frameworks, processes and network engineers.

The Federal Financial Institutions Examination Council (FFIEC) is an interagency of government that was established on the 10th of March, 1979. FFIEC is saddled with the responsibility of developing the Cybersecurity Assessment Tool, which is then used as a self-assessment tool for identifying the maturity of a bank's or financial institution's cybersecurity.

I think you have been doing a great job but you haven’t been signing many people up for our new service feature I want you to set a goal of signing up 25% of your new customers for our new service feature if I get 96 new customers that means I have to get how many of them to sign up

Answers

Answer:

24 customers

Explanation:

Given

[tex]Customers = 96[/tex]

[tex]p = 25\%[/tex] --- proportion to sign up

Required

The number of customers to sign up

This is calculated as:

[tex]n = p * Customers[/tex]

So, we have:

[tex]n = 25\% * 96[/tex]

[tex]n = 24[/tex]

Help Pls
I need about 5 advantages of E-learning​

Answers

Answer:

Explanation:

E-learning saves time and money. With online learning, your learners can access content anywhere and anytime. ...

E-learning leads to better retention. ...

E-learning is consistent. ...

E-learning is scalable. ...

E-learning offers personalization.

Answer:

E- learning saves time and money

E-learning makes work easier and faster

E- learning is convenient

E- learning is consistent

E- learning is scalable

Explanation:

when you learn using the internet, you save a lot of time by just typing and not searching through books

what are the services offered by web-based email?​

Answers

Answer:

Web based email is a service that allows to access and use electronic mail via web browser.

It allows clients to login into the email software running on a web server to compose, send and receive, delete mails basically.

What is the definition of: a computer network? data communications? telecommunications? a local area network? a personal area network? a metropolitan area network a wide area network? network management? convergence? g

Answers

Answer:

The answer is below

Explanation:

1. Computer Network: this is a system of interconnection of computers and computing devices that utilizes wires or radio waves over certain reachable locations.

2. Telecommunications: this is known to be the system or combination of telephones device and networks that transmit telephone signals.

3. A local area network: often referred to as LAN, is a system of networks that covers a smaller area usually within a room, floor, building, or campus.

4. Personal area network: often referred to as PAN, this is a network that covers few distances, usually between wireless devices like PDAs, laptops, and other devices.

5. Metropolitan area network: often referred to as MAN, this is a system of the network that serves quite a larger area, usually between that serve an area of 1 to 30 miles radius. For example, a typical city.

6. Wide area network: often referred to as WAN, this is a system of a large network that covers a large area such as parts of states, many states, countries, and the world at large.

7. Network management: this is defined to be a process of designing, installing, and supporting a computer network, such as computer hardware and software

8. Convergence: this is known to be a connection, combination, and integration of two or more computer technologies in a single device or system for operation.

Research via the internet and find an article in the news regarding wireless hacking, hardware hacking, or other security breach. As security and IT changed so rapidly, your article should be no older than 2007 (i.e. Less than 5 years old). Summarize the article using at least 500 words.

Answers

Hi, I provided some explanation of key terms.

Explanation:

Wireless hacking: basically the term refers to any unethical activity carried over a radio wave-connected network (eg Internet or Wifi connection) that would provide unauthorized access to information.

Hardware hacking: On the other hand, hardware hacking involves resetting physical hardware with the objective of using it in a way not originally intended by the manufacturer.

Write an application that throws and catches an ArithmeticException when you attempt to take the square root of a negative value. Prompt the user for an input value and try the Math.sqrt() method on it. The application either displays the square root or catches the thrown Exception and displays an appropriate message.

Answers

Answer:

Sample output:

Enter the number: 25

The square root of 25 is: 5

Enter the number: -25

The square root of 25 is: Nan

Explanation:

Here the code is given as follows,

Please draw the dynamic array stack structure (you must mention the size and capacity at each step) after the following lines of code are executed. You should assume that the initial capacity is 2 and a resize doubles the capacity.

values = Stack()
for i in range( 16 ) :
if i % 3 == 0 :
values.push( i )
else if i % 4 == 0 :
values.pop()

Answers

Answer:

Explanation:

dxfcgvhb

what is programming language?​

Answers

Answer:

A programming language is a formal language comprising a set of strings that produce various kinds of machine code output. Programming languages are one kind of computer language, and are used in computer programming to implement algorithms. Most programming languages consist of instructions for computers

Answer:

The artificial languages that are used to develop computer programs are called programming language . hope this help!

Give three reasons to use a hard drive as mass storage.

Answers

Answer:

Every computer – whether it's a tower desktop or laptop – is equipped with an internal hard drive. The hard drive is where all your permanent computer data is stored. Whenever you save a file, photo, or software to your computer, it's stored in your hard drive

Explanation:

Backups and Archives. ...

Media Libraries. ...

Large Capacity Storage. ...

NAS Drives and Security. ...

RAID Arrays. ...

Other Uses.

Draw AND, OR, XOR and XNOR gates with truth table and logic gates.

.​

Answers

Answer:

see picture. let me know if you have questions.

Other Questions
When a hurricane approaches land, people living directly on thecoast should always evacuate when told to do so by authorities. please help me with this I will give brainliest 1. What happens to the rubber band when you pulled? a. The rubber band stretches c. Nothing happens to the rubber band. b. The rubber band suddenly cut out. D. all of the above 2. Using this model identify the type of fault. a. Strike-slip fault. b. Normal Fault c. Reveres Fault d. all of the above 3. This is the location on the surface of the Earth directly above the focus. a. Focus b. Fault c. Epicenter d. All of the above 4. It is where the earthquake starts. a. Focus b. Fault c. Epicenter d. All of the above 5. Which of the following is not related to earthquake? A. Ground shaking B. Fault C. After shocks D. Typhoon 6. Which of the following are safer place during an earthquake? A. Inside the house B. Outside in an open area C. Inside the car D. Under a tre Items 7-10 refer to the diagram below. C B GA Mrs. Adenan sold 63 bracelets at one craft fair and 36 bracelets at a second craft fair. Which expression correctly applies the distributive property to show equivalent expressions for the total number of bracelets she sold?63 + 36 = (3) (21) + (9) (4)63 + 36 = (7) (9) + (12) (3)63 + 36 = 9 (7 + 4)63 + 36 = 3 (21 + 9) Ricky has seven dollars and one cent.How is that amount written using a dollar sign? All of the following are principles of the U.S. Constitution EXCEPT:A Separation of powersBChecks and balancesc) PatriotismD Federalism MARKING AS BRAINLIEST!! Starr if given functions are inverse)! What is the relationship between transit duration and orbital period? what is the acceptable macronutrient distribution range for carbohydrates QUESTION 7Find the slope of the line passing through the points (8, 3) and (9,7).A. 4B. -4C. 1/4D. -1/4 Beeswax used in making candles is produced by honeybees produce 7 pounds of honey for each pound of wax they produce. How many pounds of honey is produced if 145 pounds of beeswax Which of the sets of ordered pairs represents a function? (4 points)A = {(4, 5), (1, 1), (2, 2), (2, 3)}B = {(2, 2), (3, 2), (9, 3), (9, 3)} aOnly A bOnly B cBoth A and B dNeither A nor B Solve: 1.Square both sides of the equation.2.Expand the left side.(3 k)(3 k) = 3k + 13.Multiply9 6k + k2 = 3k + 14.Write the quadratic equation in standard form.k2 9k + 8 = 05.Factor the quadratic equation.(k 8)(k 1) = 06.Use the zero product property. The solutions to the quadratic equation are .The true solution(s) to the radical equation Which of the following illustration do not show congruence. What would American politics and government be like without political parties? The graph below shows the change in the frequency of one allele over 500generations in a large population. Which of the following statementsdescribes the change depicted in the graph? Read this sentence from the introduction of the passage. If other package delivery services can make money, the USPS should be able to make money too.Which logical fallacy is found in this sentence?Select one:a.red herringb.non sequiturc.false analogyd.bandwagon appeal In a scale drawing, 3 millimeters represents 17 meters. Exactly how many millimeters represents 55 meters? How many solutions does this system have?y = 2/3x + 32x - 3y = -9A. one solution (what i think) ****B. two solutionsC. no solutionsD. infinitely many solutions How long did it take for French immigrants to get to Ellis Island?