Stock_File_1’, a stock trend forecasting company has just employed you as a Data Scientist. As a first task in your new job, your manager has provided you with a company’s stock data and asked you to check the quality of the data for the next step of analysis. Following are the additional description and information about the data which your manager has shared with you.
a) The data set contains six variables namely-
i. Date
ii. Open
iii. High
iv. Low
v. Close
vi. Volume
Consider a following function f:
def mys(m):
if m==1:
return(1)
else:
return(m+mys(m-1))
Polynomial
Given polynomial, write a program that prints polynomial in Cix^Pi + Ci-1x^Pi-1 + .... + C1x + C0 format.
Given polynomial, write a program that points in Cix^Pi+Ci-1x^Pi-1
def h(n):
s = 0
for i in range(2,n):
if n%i == 0:
s = s+i
return(s)
In a class test teacher announces the marks (negative marking allowed) of n students a student can achieve max 100 marks. Write a python function p-marks(*marks) that takes no. 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 re-sort(*marks) which returns the students marks as a comma-separated string with elements in ascending order ( You can use built-in function max() or min() to do this) . Specify input in fixed form.
Janhvi is studying about the python list . She is facing the problem to predict the output
of following python code
1
lst1 = [10, 15, 20, 25, 30]
lst1.insert( 3, 4)
lst1.insert( 2, 3)
print (lst1[-5]
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’?
def total_number_sequence(m, n):
if m < n:
return 0
if n == 0:
return 1
res = (total_number_sequence(m - 1, n) +
total_number_sequence(m // 2, n - 1))
return res
if __name__ == '__main__':
m = 10
n = 100
print('Total number of possible sequences:', total_number_sequence(m, n))
PROBLEM: 3N+1 sequence: determine which value(s) of N generate the longest sequence for the famous 3N+1 sequence. Refer to 8.5 in your runestone text for more details. Output the value(s) of N that generate the longest sequence.
C version: use 100 as the value of N
Consider the following to help you better understand how to solve this problem.
OUTPUT FORMAT:
C version - a single number
What is wrong with my code?
write a python programs that accepts three inputs x,y,z print true if x*y>z otherwise false