Write the commands to do the following operations on the dataframes given above : (i) To add dataframes df1 and df2. -Technology

1 Answer

Answer :

import numpy as npimport pandas as pddf1 = pd.DataFrame({'mark1':[30,40,15,40],'mark2':[20,45,30,70]});df2 = pd.DataFrame({'mark1':[10,20,20,50],'mark2':[15,25,30,30]});print(df1)print(df2)(i) print(df1.add(df2))(ii) print(df1.subtract(df2))(iii) df1.rename(columns={'mark1':'marks1'}, inplace=True) print(df1)(iv) df1.rename(index = {0: 'zero', 1:'one'}, inplace = True) print(df1)

Related questions

Description : Rishi, a class XII student has given following commands for the given purposes: (i) To add a new column “Rating” : -Technology

Last Answer : No, above commands will not be able to achieve desired task as update and alter commands have been interchanged.In order to achieve desired result, following corrections should be incorporated in the previously used ... give an increase of 50 Rs. to all the books:Update library set price=price+50;

Description : With reference to the above given tables, write commands in SQL for (i) and (ii) and output for (iii) below: -Technology

Last Answer : (i) select TName, Passenger from Train T, Reservation R where T.TrainId=R.TrainId;(ii) select T.* from Train T, Reservation R where T.TrainId!=R.TrainId;(iii)TrainIdTNameSourceDestination3424Lucknow MailLucknowNew Delhi5400Century ExpressNew DelhiKanpur

Description : Consider the following table Furniture. Write SQL commands for the statements (i) to (viii) and write output for SQL queries (ix) and (x). -Technology

Last Answer : SQL commands for the given statements (i) to (viii) ;1. SELECT FCODE, NAME. PRICE FROM Furniture WHERE PRICE < 5000;2. SELECT NAME. PRICE FROM Furniture3.4. WHERE NAME LIKE %table% ;5. SELECT DISTINCT WCODE ... ;15.16. Output for SQL queries (ix) and (x)(ix)SUM(PRICE)6500(x)COUNT(DISTINCT PRICE)5

Description : Write SQL Query commands based on the following table: -Technology

Last Answer : This answer was deleted by our moderators...

Description : Consider the decimal number x with value 8459.2654. Write commands in SQL to: i. round it off to a whole number -Technology

Last Answer : i. select round(8459.2654);ii.select round(8459.2654,-2);

Description : Consider the following SQL string: “Preoccupied” Write commands to display: (a)“occupied” (b)“cup” -Technology

Last Answer : commands to display:(a)“occupied” (b)“cup”

Description : Considering the same string “Preoccupied” Write SQL commands to display: (a) the position of the substring ‘cup’ in the string “Preoccupied” -Technology

Last Answer : (a)select instr 'Preoccupied' , ‘ 'cup'));(b)select left 'Preoccupied',4);

Description : In the _____ method, time isdivided into intervals. In each interval, a reservation frameprecedes the dataframes sent in that interval. A) reservation B) polling C) token passing D) none of the above

Last Answer : reservation

Description : What are the commands contained by Create tab? -Technology

Last Answer : The Create tab has various commands such as Table Design, Table Templates, Pivotchart, Form, Report, Macro and Query Wizard.

Description : What is table? Name the basic commands for creating a table. -Technology

Last Answer : Tables are made up of rows and columns. In HTML, tables are used to display tabular data in Web pages.The basic commands for creating tables are as follows:Table tags Row tags Cell tags andCaption tags .

Description : Anjali writes the following commands with respect to a table employee having fields, empno, name, department, commission. -Technology

Last Answer : This is because the column commission contains a NULL value and the aggregate functions do not take into account NULL values. Thus Command1 returns the total number of records in the table whereas Command2 returns the total number of non NULL values in the column commission.

Description : Write command for the operations (i) to (iii) based on the spreadsheet below: -Technology

Last Answer : 1. At cell F2, type =D2*E2 and then copy this formula using mouse Fill handle onto range F3: F5.2. At cell G2, type =IF(C2=”Consumable”, F2*0.07, F2*0.11) and then copy this formula using mouse Fill handle onto range G3: G5.3. At cell G6, type =SUM(G2: G5).

Description : Write the SQL functions which will perform the following operations: (i) To display the name of the month of the current date . -Technology

Last Answer : (i) monthname(date(now()))(ii) trim(“ Panaroma “)(iii) dayname(date(dob))(iv) instr(name, fname)(v) mod(n1,n2)

Description : I put myself as a OP on a server for minecraft and none of the commands are working what do I do?

Last Answer : answer:Make sure you’re putting the / before your server commands, of course. Otherwise, try and restart the server. Some changes like enabling monsters take time and a few restarts occasionally.

Description : You happen to have purchased a house from the future. It accepts all kinds of voice commands. What are some of your commands?

Last Answer : “Make Bacon”

Description : A sales manager creates a presentation he add the same slide transition to all the slide. Write steps, -Technology

Last Answer : Creating a slides show:Using PowerPoint, a wide range of special effects, such as transition and animation can be added in a presentation to provide visual interest to the presentation and grab ... Transitions to a Slide2. Add Sound to Slide Transitions3. Animating Text and Objects4. Rehearse Timing

Description : Write the command using Insert() function to add a new column in the last place(3rd place) named “Salary” from the list Sal=[10000,15000,20000] -Technology

Last Answer : EMP.insert(loc=3,column=”Salary”,value=Sal)

Description : Operations performed on a database are controlled by (a) user (b) hardware -Technology

Last Answer : (a) Users are those persons, who need the information from the database to perform operations.

Description : Operating system refers to the core software components of a computer system that manages internal operations and hardware. -Technology

Last Answer : TrueOperating system is a set of programs that control internal computer operations and make best use of hardware.

Description : Describe the basic operations of mouse button. -Technology

Last Answer : Some basic mouse operations are as follows:1. Pointing Pointing to an item on the screen means moving a pointer to a certain location. When you point to some object, a small box often appears, that ... Right click an item, point to the item that you want perform and then, click the left button.

Description : The ………….. and …………… operations copies data from source range to target range and erases it from the source range. -Technology

Last Answer : The cut and paste operations copy data from the source range to a target range and erase it from the source range.

Description : Write the general formats for file opening and file closing commands?

Last Answer : Ans: For Opening:- fp=fopen(“filename” , “mode”); where ‘fp’ refers to the file pointer. ‘filename’ refers to the name of the file to be opened. ‘mode’ refers to the mode of accessing data. For Closing:- fclose(fp); where fp denotes the file pointer.

Description : Write the output for the following commands: (i) ls –a (ii) date “+%D”

Last Answer : i) ls –a : list all files including hidden files. These are files that start with “.”. ii) date “+%D” : Display date as mm/dd/yy. output: 11/26/19

Description : Write syntax for following commands: i)Sleep ii)Kill

Last Answer : i)sleep Syntax: sleep NUMBER[SUFFIX]… sleep OPTION ii) kill Syntax: kill pid

Description : Which of the following commands is given to reboot the computer? 1) Ctrl + Alt + Del 2) Ctrl + Alt + Tab 3) Ctrl + Shift + Del 4) Ctrl + Alt + shift

Last Answer : 1) Ctrl + Alt + Del

Description : GO BOTTOM and SKIP-3 commands are given one after another in a database file of 30 records. It shifts the control to (A) 28th record (B) 27th record (C) 3rd record (D) 4th record

Last Answer : (B) 27th record

Description : How can you add a record in the table in Datasheet View? -Technology

Last Answer : Insert a RecordSteps to insert a record in a Datasheet View are as follows:Step 1When you create a table, a new blank record automatically appears in the second row of the table or If you enter ... into the fields.Step 3When you have finished adding records in the datasheet, save it and close it.

Description : For what, Memo data type is used? (a) To add table (b) To store objects created in other programs -Technology

Last Answer : (c) As we know, Memo provides character upto 65536 so, it is used for long text entries.

Description : Which property is used to add a label to the field to assist the user? (a) Default value (b) Caption (c) Format -Technology

Last Answer : (b) Caption is used to add a label to the field for assisting to the user.

Description : Which tag is used to add columns in the tables? (a) (b) -Technology

Last Answer : (b) is used to add columns in the tables.

Description : In order to add border to a table, border attribute is specified in which tag? (a) (b) -Technology

Last Answer : (b) border attribute is specified in tag.

Description : Sona wants to add her pictures in a Word document. 1. Which tab she should use? 2. Which command she should use to open Insert Picture dialog box? -Technology

Last Answer : 1. Insert tab2. Picture command in the Illustrations group.3. Yes4. Yes

Description : Kirti wants to add sound to slide transition. Which feature of Animations tab is useful for this purpose? -Technology

Last Answer : On the Animations tab in the Transition to This Slide group, click the arrow next to ‘Transition Sound’ to add sound to slide transition.

Description : Which among the following views allows you to add some extra information to a slide which is not viewed during the presentation. -Technology

Last Answer : c) Notes Page view allows you to add some extra information related to presentation but it is not viewed during the presentation.

Description : Why we cannot add titles to an embedded chart once chart is ready? -Technology

Last Answer : Titles have not been entered in chart elements step. And, these cannot be added later once the chart is ready.

Description : (i) Ms. Sangeeta wants to add few descriptive lines in the HTML code which should not be displayed on the webpage rather -Technology

Last Answer : (i) She should use comments in HTML.Any text to make comments in HTML, should be preceded by Example:Welcome(ii)HTML is used to display data and to focus on formatting of data, whereas XML ... XML is used to store and transfer the data over different platforms while HTML is used to design webpages.

Description : Which property is to be used during design time to add a list of countries in the list box? -Technology

Last Answer : Model property

Description : In a school, a database named “school” is created in mysql whose password is “cbse”. Smith is trying to add a new record of a student having details -Technology

Last Answer : import mysql.connectormydb = mysql.connector.connect{host='localhost',user='root',passwd='cbse',database='school'}mycursor = mydb.cursor()mycursor.execute('INSERT INTO student values(3,'Michelle', 'Agartala');')mydb.commit()

Description : How to add stops in your route without leaving the navigation mode ? -Technology

Last Answer : Well, you can. Just get directions between the first two locations as usual, then tap the menu icon on the top right and choose ' Add Stop'. Search for the next location, and click ' Add Stop' as many times as you like until your route is finished.

Description : A farmer, in order to save one spraying operations mix herbicides, insecticide, fungicide etc. at the time of spray, to achieve this feature add a). Compatibility agents b). Spreaders c). Activators d). Adhesive

Last Answer : a). Compatibility agents

Description : Write the HTML code to create the exact table which is given below: ADMNO SNAME NAME DOB -Technology

Last Answer : The HTML code is ADMNO SNAMENAMEDOB1110MANJITRANJIT4-MAR-1998

Description : Write the HTML code to generate the following web page with the given below specifications: -Technology

Last Answer : Income Tax Slabs 2017-18INCOME TAX SLABS 2017-18S.No.Income RangeTax%10-250000NIL2250001-50000010%3500001-100000020%4>100000030%Next Page

Description : Write a code to plot the speed of a passenger train as shown in the figure given below: -Technology

Last Answer : import matplotlib.pyplot as pltimport numpy as npx = np.arange(1, 5)plt.plot(x, x*1.5, label='Normal')plt.plot(x, x*3.0, label='Fast')plt.plot(x, x/3.0, label='Slow')plt.legend()plt.show()

Description : Write a python code to create a data frame with appropriate headings from the list given below : -Technology

Last Answer : import pandas as pd# initialize list of listsdata = [['S101', 'Amy', 70], ['S102', 'Bandhi', 69], ['S104','Cathy', 75], ['S105', 'Gundaho', 82]]# Create the pandas DataFramdf = pd.DataFrame(data, columns = ['ID', 'Name', 'Marks'])# printdataframe. print(df )

Description : Write a small python codeto create a dataframewith headings(a and b) from the list given below : [[1,2],[3,4],[5,6],[7,8]] -Technology

Last Answer : import pandas as pddf = pd.DataFrame([[1, 2], [3, 4]], columns = ['a','b'])df2 = pd.DataFrame([[5, 6], [7, 8]], columns = ['a','b'])df = df.append(df2)

Description : Write the code given below using ‘for’ loop instead of ‘while’ loop : -Technology

Last Answer : The given code using ‘for’ loop instead of ‘while’ loop :int ifor (i = 1 ; i < = 5 ; i + +){if (1 * i = = 4)jTextFieldl. setText ( “ “ + i) ;}

Description : Given the following Series S1 and S2: Write the command to find the sum of series S1 and S2 -Technology

Last Answer : print(S1+S2)

Description : Consider a given Series , M1: Write a program in Python Pandas to create the series. -Technology

Last Answer : import pandas as pdm1=pd.Series([45,65,24,89],index=['term1','term2','t erm3','term4'])

Description : Do speech commands, or speech to text apps help or hurt our actual speech abilities?

Last Answer : answer:My speech skills are impeccable. Siri loves me.

Description : Can you help me with some very basic puppy training commands?

Last Answer : You could either take her to a class near you such as the ones at Pet Smart or search google for some videos on training. I saw a few out there and one was from IAMS, one from Purina, and I'm ... system. Everytime she does something you want her to do, give her a treat and a loving pat on the head.