Last active
January 12, 2024 17:40
-
-
Save devmnj/256d376df5d8602cb5014c7376376388 to your computer and use it in GitHub Desktop.
Steps to prepare dataframe for Algo in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I encounter proplem while using Historical data | |
# For yfinance most of the case the data is in good shape | |
# The first thing I am looking for index column, of numbers. if it exist, need to replace with datetime | |
# the last thing I want make sure that the date column is in panda datetime type otherwise have to covert it. | |
df =pd.DataFrame(data['Success']) | |
df =df[['datetime','open','high','low','close','volume']] | |
df['datetime']= pd.to_datetime(df['datetime']) | |
df.set_index('datetime', inplace=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment