Skip to content

Tag: pandas

Y finance Date alignment

This might be a relatively difficult question; The scope of the code I want to write, is to automate the alignment of Dates that i pull from yfinance regarding BTC and S&P 500 since the S&P500 (SPY) is not traded on weekends, but BTC is, I want to automatically delete the columns of dates from BTC tha…

Changing column various string formats in pandas

I have been working on a dataframe where one of the column (flight_time) contains flight duration, all of the strings are in 3 different formats for example: “07 h 05 m” “13h 55m” “2h 23m” I would like to change them all to HH:MM format and finally change the data type from…

Pandasql Exception with OVER

I tried to use this line of code : NB : delete ‘locals()’ or replace by ‘globals()’ don’t solve the problem. But I have this error : http://sqlalche.me/e/14/e3q8 (Same error with Average) I load my dataframe like this : My file is in the same directory as my Jupiter notebook file…