Skip to content

Pandas: Apply rolling window on complex function (Hurst Exponent)

In a nutshell: I need to calculate the Hurst Exponent (HE) across a rolling window inside a pandas dataframe and assign the values to its own column. The HE function I use was lifted from here as it seemed more robust. For convenience it’s posted below: Now in order to test the function let’s grab…

Tkinter output to GUI textbox

new to GUI creation with python, I have the following code, how can I make the print command appear on the GUI not the command line? I’m wanting to show the print in the GUI as a text box or some kind of output window so the process can be shown. Answer You can add a label for output underneath

Pandas : DataFrame columns are not unique when making dictionary

I have a dataframe like this: Name Alt_01 Alt_02 AAPL Apple apple Inc. AMZN Amazon NaN in order to check if string contains alt names, I build code like: Since not all the names have same amount of alternative names, I put dropna() function to remove NaN values. But after I do this, I receive message like: Us…

How to use JOIN and SELECT AS together in SQLAlchemy?

I have the two following tables. Users Table id name email 32 Hello e@mail.com 23 World p@mail.com Sales Table id SellerId CustomerId Amount 4 32 23 25 I want to join the tables in the following way to get this result. Here I want to only get the entries where customer id is equal to 23. Id SellerId SellerNam…

Python between syntax (IF statement)

I am currently working on creating python automation tool based on excel file and basic idea of this project is allocation data into specific people automatically. However, I faced a small problem which is to make a condition for right allocation. Data for conditions in Excel: Description : I’d like to …