Briefly explain the purpose of Boolean Indexing with respect to DataFrames. Support your answer with a suitable example.
import pandas as pd
df = pd.DataFrame({'Name': ['Asha', 'Ravi', 'Meena'], 'Marks': [92, 75, 85]})
print(df[df['Marks'] > 80])The condition df['Marks'] > 80 gives the Boolean Series True, False, True. (a) What is data protection?
(b) Mention any two precautionary measures one can take to avoid the risk of cybercrime.
Consider the DataFrame Scholarship shown below:
| Name | Course | Amount | |
|---|---|---|---|
| 0 | Ananya | B.Sc. | 62000 |
| 1 | Karan | B.Tech | 67000 |
| 2 | Simran | MCA | 64000 |
| 3 | Rahul | BCA | 70000 |
| 4 | Priya | BA | 69000 |
Answer the following questions:
Write suitable SQL query for the following:
I. To display only the date part from the date/time expression '2026-01-01 10:10:10'
II. To convert all customer names from the Cust_Name column to lowercase in the Customer table.
III. To extract the first 4 characters from the City_Name column in Location table.
IV. To display the name of the city from the CITY column in EVENT table, after removing leading spaces.
V. To find the average salary from Salary column in Employees table.
Write suitable SQL query for the following:
I. To display the value of 172.
II. To display the day part of the dates in the Hire_Date column of the Employee table.
III. To display the maximum value of the Bill_Amount column in the Bill table.
IV. To remove leading and trailing spaces from the Location column in the Branch table.
V. To display total salary from tot_sal column in Employees table.
(i) Write an SQL statement to create a table named PRODUCTS with the following specifications:
| Column Name | Data Type | Key |
|---|---|---|
| PID | Integer | Primary Key |
| PName | Varchar of size 30 | |
| PCat | Char of size 15 | |
| Price | Decimal Number |
(ii) Write an SQL query to increase the price of all items by 100, whose product category is Grocery, in the table PRODUCTS.
Consider the DataFrame Scholarship shown below:
| Name | Course | Amount | |
|---|---|---|---|
| 0 | Ananya | B.Sc. | 62000 |
| 1 | Karan | B.Tech | 67000 |
| 2 | Simran | MCA | 64000 |
| 3 | Rahul | BCA | 70000 |
| 4 | Priya | BA | 69000 |
Answer the following questions:
Niharika wants to create a Pandas Series using a NumPy array with three elements 'a', 'b', and 'c', and assign custom indexes 'first', 'second' and 'third'. Help her complete the code below.
import pandas as pd
import ______ as np
arr = np._____ (['a' , 'b' , 'c'])
s = pd._____(arr,_____=['first','second','third'])
print(s)Write a Python program to create and display a Pandas Series as shown below:
| July | 31 |
|---|---|
| Aug | 31 |
| Sept | 30 |
| Oct | 31 |
The index labels are the names of the months – July, Aug, Sept, Oct.
The corresponding scalar values are the number of days in these respective months – 31, 31, 30, 31.
Write the output of the following code:
import pandas as pd
s1 = pd.Series ([1, 2, 3], index = ['a','b','c'])
s2 = pd.Series ([4, 5, 6], index = ['b','c','d'])
print (s1 + S2)List any two characteristics of Pandas library in Python.
(a) What is data protection?
(b) Mention any two precautionary measures one can take to avoid the risk of cybercrime.

The electric potential for various points in $x$-$y$ plane is given by $V = 1.0 x^2 - 2.0 y^2$, where $V$ is in volts and $x$, $y$ are in metres. The angle that the electric field at point $(2.0$ m$, 1.0$ m$)$ makes with the positive $x$-axis is: