Pandas allow adding the inputs to the index argument if you create a DataFrame. It will make sure that you have the desired index. If you don’t specify inputs, the DataFrame contains, by default, a numerically valued index that starts with 0 and ends on the last row of the DataFrame.
Adding Rows to a DataFrame:
We can use .loc, iloc, and ix to insert the rows in the DataFrame.
The loc basically works for the labels of our index. It can be understood as if we insert in loc[4], which means we are looking for that values of DataFrame that have an index labeled 4.
The iloc basically works for the positions in the index. It can be understood as if we insert in iloc[4], which means we are looking for the values of DataFrame that are present at index '4`.
The ix is a complex case because if the index is integerbased, we pass a label to ix. The ix[4] means that we are looking in the DataFrame for those values that have an index labeled 4. However, if the index is not only integer-based, ix will deal with the positions as iloc.
Adding Columns to a DataFrame
If we want to add the column to the DataFrame, we can easily follow the same procedure as adding an index to the DataFrame by using loc or iloc.
Generate a complete, print-ready paper with questions like this in minutes — across 16+ boards, with answer keys.
Table: TEACHER
| TID | NAME | AGE | DEPT | DATEOFJOIN | SAL | SEX |
| T118 | Navin | 40 | Computer | 2010-01-10 | 12000 | M |
| T107 | Chetna | 37 | History | 2008-03-24 | 20000 | F |
| T105 | Sandeep | 46 | Maths | 2006-12-12 | 30000 | M |
| T110 | Sangeeta | 35 | History | 2010-07-01 | 25000 | F |
| T101 | Rudransh | 42 | Maths | 2004-09-05 | 40000 | M |
| T121 | Neeraj | 38 | Physics | 2011-04-01 | 28000 | M |
(i) To show information about the teachers of the history department.
(ii) To list the names of teachers earning a salary between 20000 and 30000.
(iii) To count the number of male teachers.
(iv) Display gender wise total number of teachers.
(v) To list the name and age of teachers of female teachers in descending order of date of join.
(vi) Increase the salary by 10% for Maths departments.
( vii) To delete the record of teacher Neeraj.
where n and x have to be input from the user. The function should have two parameter n and x and return the sum of the series.
(i) To import the pandas
(ii) To create the series from the list
(iii) To print List.
(iv) To print the index of the series.
(v) To print the values of the series.
Building to Building distances (in Mtrs.)
| FROM | To | Distance |
| Administrative Building | Finance Building | 60 |
| Administrative Building | Faculty Studio building | 120 |
| Finance Building | Faculty Studio building | 70 |
Number of computers in each of the blocks/Center is as follows:
| Administrative Building | 20 |
| Finance Building | 40 |
| Faculty Studio building | 120 |
(a) Suggest the most appropriate building, where EPG should plan to install the server.
(b) Suggest the most appropriate building to building cable layout to connect all three buildings for efficient communication.
(c) Which type of network out of the following is formed by connecting the computers of these three buildings?
LAN, MAN, WAN
(d) Which wireless channel out of the following should be opted by EPG to connect to students of all over the world?
Infrared, Microwave, Satellite