Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

1. Correlation between two variables X&Y is 0.85. Now, after adding the value 2 to all the values of X, the correlation co-efficient will be______

2. A) Read the given dataset “Tips.csv” as a dataframe “Data”. Give 3 commands to extract the columns in the following sequence - Time, TotalBill, Tips?

 

B)     Read the given excel sheet ‘Tips1.xlsx’ as a dataframe ‘Data1’. What command should be given to merge the two data frames ‘Data’ and ‘Data1’ by columns?

 

C)     Copy the 'Data1' dataframe as 'Data2' (Data2 = Data1.copy()) and identify the command to find the total tips received across Day’s from the dataframe ‘Data2’?

 




Write a Python class, Rectangle. The class will have instance variables length and width


and a method which will compute the area of a rectangle. Include the constructor and


other required methods to set and get class attributes. Also, include a method isSquare(),


which returns a Boolean value indicating if the shape is a square. (Hint: use @property)



I = P*N*R . The total amount to repay will be A = P + I

Input Commands

There are 3 input commands LOAN, PAYMENT, BALANCE

LOAN

Format - LOAN BANK_NAME BORROWER_NAME PRINCIPAL NO_OF_YEARS RATE_OF_INTEREST

Example- LOAN IDIDI Dale 10000 5 4 means a loan amount of 10000 is paid to Dale by IDIDI for a tenure of 5 years at 4% rate of interest.

PAYMENT

Format - PAYMENT BANK_NAME BORROWER_NAME LUMP_SUM_AMOUNT EMI_NO

BALANCE

Input format - BALANCE BANK_NAME BORROWER_NAME EMI_NO

Output format - BANK_NAME BORROWER_NAME AMOUNT_PAID NO_OF_EMIS_LEFT


Assumptions

1. Repayments will be paid every month as EMIs until the total amount is recovered.

2. Lump sum amounts can be paid at any point of time before the end of tenure.

3. The EMI amount will be always ceiled to the nearest integer.

INPUT:

LOAN IDIDI Dale 10000 5 4

LOAN MBI Harry 2000 2 2

BALANCE IDIDI Dale 5

BALANCE IDIDI Dale 40

BALANCE MBI Harry 12

BALANCE MBI Harry 0

OUTPUT:

IDIDI Dale 1000 55

IDIDI Dale 8000 20

MBI Harry 1044 12

MBI Harry 0 24




 In a class test the teacher announces the marks (negative marking is allowed) of n (n>0) students. A student can achieve maximum 100 marks. Write a python function print_marks(*marks)  that takes number of students, marks of students and return the marks and check the marks are valid or not. If valid then it calls the recursive function rec_Sort(*marks) which returns the students marks as a comma-separated string with elements in ascending order. (You can use of built-in function max ()/min() to do this)



Write a python function Sum(ele) which takes a comma-separated string of numbers and returns the reverse of the sum of the smallest and largest numbers in the given list as shown in the example. For example, for the list 10, 23, 14, 25, the sum of smallest and largest numbers is 35. And the reverse of 35 is 53.

NOTE:

  1. Write a separate recursive function reverse_num(num)to compute the reverse of a number and call this function inside the Sum(ele).
  2. Do not use the input() function for taking input from the keyboard. Specify the input in fixed form but function must be generalized that can work with values.




Artificial Mouse Population satisfying the following conditions:

  1. Two mouses are born, one by one in first and second month respectively. This newly born pair of mice build the initial population.
  2. These mice can mate at the age of second month such that this mice pair brings another pair of micein thethird month. So, in this way the mouses produced in a particular month will be equal to sum of mouses produced in the previous two months.
  3. If the x and y mouse are produced in first and second months to form a initial population, there will be x+y mouses in the third month.
  4. These mice are immortal. They will not die.

Write a function gen_population_series (x, y, n)  which takes initial population as x, y and a positive integer number n as number of months and returns number of mouses produced in each month till nth month in string format using recursion.


1. Consider the following data to answer the question below


What is the command to convert the above dictionary into a dataframe named ‘df_state’?

2. List 3 commands to display the columns of the above dataframe df_state.

 

3. Correlation between two variables X&Y is 0.85. Now, after adding the value 2 to all the values of X, the correlation co-efficient will be______

4. A) Read the given dataset “Tips.csv” as a dataframe “Data”. Give 3 commands to extract the columns in the following sequence - Time, TotalBill, Tips?

 

B)     Read the given excel sheet ‘Tips1.xlsx’ as a dataframe ‘Data1’. What command should be given to merge the two data frames ‘Data’ and ‘Data1’ by columns?

 

C)     Copy the 'Data1' dataframe as 'Data2' (Data2 = Data1.copy()) and identify the command to find the total tips received across Day’s from the dataframe ‘Data2’?

 



Artificial Mouse population satisfying the following conditions :

i. Two mouses are born one by one in 1st and 2nd months respectively. This newly born pair of mice build the initial population.

ii. These mice can mate at the age of 2nd month such that this mice pair brings another pair of mice in the 3rd month. So, in this way the mouses produced in a particular month will be equal to sum of mouses produced in the previous 2 months.

iii. If the a and b are produced in the 1st and 2nd months to form an initial population there will be a + b mouses in the 3rd month.

iv. These mice are immortal. They will not die.


Write a python function population-series(a, b, n) which takes the population as a ,b and a

positive integer number 'n' as number of months and returns no. of mouses produced in each month till the nth month in string format using recursion.


Write a python function Sum(x) which takes a comma-separated string of numbers and returns the reverse of the sum of the smallest and largest numbers in the given list as shown in example. For ex , for the list 10,28,43,52 the sum of smallest and largest numbers is 62 and the reverse is 26. Write a separate recursive function Reverse-Sum(n)

to compute the reverse of a number and call this function inside the Sum(x). Do not use

input() function, specify the input in fixed form.


given weekday of the first day of the month, determine the day of the week of the given date in that month.

input: 1st line is a string-D

2nd line is a integer-N