Pandas
1.What is Pandas, and how does it differ from other data manipulation libraries in Python?
2.How do you read data into a Pandas DataFrame from various data sources like CSV, Excel, or SQL databases?
3.What are some common data cleaning and preparation techniques you can use with Pandas, and how do you implement them?
4.Can you walk us through the process of filtering and slicing data in a Pandas DataFrame based on specific conditions or criteria?
5.How do you handle missing data in a Pandas DataFrame, and what options are available for imputing or dropping missing values?
6.What is lock and ilock in pandas
 7.what is shape.
Â
Write a program for find largest second number from list
l =[10,20,30,30,30,40,4,4,4,4]
max1 = l[0]
smax = l[0]
for i in l:
   if i>max1:
       smax = max1
       max1 = i
   elif smax<i and i!=max1:
       smax = i
OR
def secondmax(l):
 list1 = [i for i in l if i < max(l)]
 return max(list1)
secondmax([10,20,30,30,30,4,4,4,4,4])
Write a query to fetch details of employees whose EmpLname ends with an alphabet ‘A’ and contains five alphabets.
Select * from employee
Where ename like ‘%a’Â and CHAR_LENGTH(ename) = 5;
Â
how to calculate even and odd records form table?
Query to find even record:
SELECT * FROM EMPLOYEE
WHERE id IN(SELECT id FROM EMPLOYEE WHERE id%2
= 0)
 Query to find odd record:
SELECT * FROM EMPLOYEE
WHERE id IN(SELECT id FROM EMPLOYEE WHERE id%2
<> 0)
 ‘Write a query to retrieve duplicate records
from a table?
SELECT OrderID, COUNT(OrderID)
FROM Orders
GROUP BY OrderID
HAVING COUNT(OrderID) > 1
Â
Fetch 5th highest the salary without limit
and top
select * from(select ename, salary,
dense_rank() over(order by salary desc)r from Emp) where r=5
Â
Write query for drop duplicate records
Select *, count(id)
From table_name
Group by id
Having count(id)=1
Â
 Now, assume that you have two
tables: “employees” and “salaries”.
The employee table has basic information: ID,
first name, last name, email address, address etc.
Salaries table has employee-id and salary. Query
to be executed is the same: “List names of all the employees
whose salary is greater than or equal to
Rita’s salary”.
ans: select e.first_name from employee e
inner join salary s
on e.id = s.id
where s.salary > = (select s.salary from
employee e
inner join salaries s
on e.id = s.id and e.first_name = ‘reeta’);
Â
Â
Â
Best Data Science Course In Thane With Placement 100% Placement...
Read MoreNovember 20, 2024Best Data Science Course In Satara With Placement 100% Placement...
Read MoreNovember 20, 2024Best Data Science Course In Sambhaji Nagar With Placement 100%...
Read MoreNovember 20, 2024Best Data Science Course In Solapur With Placement 100% Placement...
Read MoreNovember 19, 2024