pivot() and pivot_table() reshape a DataFrame. They turn the values of one column into new column headings. The key difference is what happens when the same pair of row and column labels appears more than once. pivot() only rearranges data. If the same pair of labels appears twice, it cannot decide which value to keep, so it raises a ValueError. pivot_table() has an aggfunc argument, with default mean. It can combine the duplicate values using sum, mean, count, and so on. So it works on data with duplicates. pivot_table() aggregates the values from rows with duplicate entries. That is exactly the extra power it has. So option 1 is correct. pivot() is the one that fails on duplicates. So option 2 is wrong. merge(), join() or concat(). It is not a pivot job. So option 3 is wrong. fillna(0). pivot_table() has an optional fill_value argument, but it is not what separates it from pivot(), and it is not the main purpose. So option 4 is wrong. Given the following DataFrame df:
| PNO | NAME |
|---|---|
| 111 | ROHAN |
| 222 | MEETA |
| 333 | SEEMA |
| 444 | SHALU |
| 555 | POONAM |
Select the correct commands from the following to display the last five rows:
Given the following series ser1:
| Index | Value |
|---|---|
| 0 | 69 |
| 1 | 80 |
| 2 | 20 |
| 3 | 50 |
| 4 | 100 |
| 5 | 70 |
State the output of the following command:
print(ser1 >= 70)
Which of the following are the correct commands to delete a column from the DataFrame df1?
Select the statements that are CORRECT regarding patterns of biodiversity.
Which of the following hormone is not produced by placenta ?
List - I | List - II | ||
| A | Streptokinase | I | Blood-Cholestrol lowering agents |
| B | Cyclosporin | II | Clot Buster |
| C | Statins | III | Propionibacterium sharmanii |
| D | Swiss Cheese | IV | Immuno suppressive agent |
Which of the following option determines percolation and water holding capacity of soils ?