I am trying to make a function where if the last value of order is 1 then the code will append 1 to orders and then append the number 20 to the value array as well. If the last value is 0 in order …

I am trying to make a function where if the last value of order is 1 then the code will append 1 to orders and then append the number 20 to the value array as well. If the last value is 0 in order …

I have this code here: def maximum(): i = int(float(input(“What is the maximum value?”))) if i < 1.2: return print("ERROR: Maximum should be greater than 1.2"), …

I know there are similar questions about passing functions into functions, but I’m not clear on the effective solution for my particular problem. The following function works but the formula is static….

The std pandas function below calculates the standard deviation of every nth value defined by number. So it would take the the values of PC_list with indexes [0,1,2,3,4,5] and calculate the standard …

I need to find a way to add new terms to the function: f(x) = 4sin(x)/pi such that the new function looks like this: f(x) = 4sin(x)/pi + 4sin(3x)/3pi + 4sin(5x)/5pi + 4sin(7x)/7pi … up to 201. I was …

I’m trying to create an additional column in a data frame to show the number of network days (excluding custom holidays) between two dates. I’m using a function to which I’m trying to pass dates from …

I want to build a function that sums two numpy arrays into a new array if and only if the distinct indices are euqal. x = np.array([2,1,1,1]) y=np.array([2,1,0,1]) overlap = np.zeros(4) for i in …

i want to input the file name in this case books.txt and get the lines but i cant get it work, i have the files in the same directory but when i run this nothing happens, any way to fix this? or to …

I have a code where I zero a column or row if it contains zero , I have my own function but when I use it it returns None , I made a copy of my matrix and performed changes on it and then I converted …

How can you configure lru_cache to key its cache based on actual values received, rather than how the function was called? >>> from functools import lru_cache >>> @lru_cache … def …