Hi I’m currently making a Bitcoin Price tracker. I have it rigged up so that it will send me an alert when Bitcoins price hits a certain point. I’m still beginner programmer, but it’s working good so far. I’m having trouble figuring out how I should scope and then call my two functions without the function calling itself over and
Tag: function
How to add mathematical function as argument in python function
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. It only works on a fixed function, namely (in mathy pseudocode) f(a) = 3^a mod 17 = b where f(11) = 7 I want to make a user
Optimizing a standard deviation function Pandas Numpy Python
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 deviation and then the indexes [1,2,3,4,5] and calculate the standard deviation until the end of PC_list. I am trying to optimize the code by trying to make it
Why does my program run without parameters inside the functions’ parenthesis?
I am going to ask probably a very silly question. I designed a code that looks like the following: main_data looks like this: Now, the “problem” is that my program runs exactly as it should. I just realized, however, that all of my functions, options(), Option1() and Option2(), do not have parameters inside the parenthesis. This is due to me
Getting the minimum indexes with numpy Python
I am trying to get the index values of the function. But I want to get the minimum instead of the maximum values of just like the post: post. I have tried to convert the function below to work for the minimum values unlike the maximum values to getting the indexes. Max Values: Index Function Answer For the minimum, you
When creating a function with summation in it, how do you add terms to the summation? (Python)
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 thinking I could create the function with a for loop inside that would iterate using a list n but there must
Passing datetime64[ns] from pandas’ data frame as an argument to a function
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 df’s columns as arguments, but I can’t make it work. Below is my code (I’m using two made-up holidays in the given set): The
Python, Tkinter entry get to function (error was with function call from button)
The entry value is just simply doesn’t get passed into the function, whatever I do. Edit: I just realized, if I add a variable to the function, it gets called as soon as I run the program, and it doesn’t care about the button; but if I don’t give it a variable, it works as it should, only when I
Why is the result different ,despite the code is exactly the same?
I want to build a function that sums two numpy arrays into a new array if and only if the distinct indices are euqal. That worked as expected. Now I want to define the function, but the ouput is different, despite that the code is exactly the same. I think it has something to do with the iterator, but i
Is there a built-in way for converting a list to a function?
Suppose I have a Python list lst. I want to convert this to a function or callable, which may be done by: or (less preferably): However, as this seems to be a very natural operation, I wondered whether there exists a built-in (perhaps more efficient) way to achieve this. (To be a little bit more precise: Is there a Python