Skip to content

Added timeseries to dataframes that return a date#1

Open
bdaniels22 wants to merge 1 commit into
Quiver-Quantitative:mainfrom
bdaniels22:main
Open

Added timeseries to dataframes that return a date#1
bdaniels22 wants to merge 1 commit into
Quiver-Quantitative:mainfrom
bdaniels22:main

Conversation

@bdaniels22

@bdaniels22 bdaniels22 commented Feb 13, 2021

Copy link
Copy Markdown

Feels like this would easier to use with libraries like yfinance that return a dataframe with a timeseries. Made it so that wallstreetbets, congressional trading, lobbying, and wikipedia return a dataframe with an index that is a timeseries rather than an integer.

Done by using a simply if statement:

`if len(ticker) > 0:
     # converts index of pandas dataframe to Date time index rather than a tuple
            
     df["Date"] = pd.to_datetime(df["Date"])
            
     df = df.set_index("Date")`

@ckardatzke ckardatzke left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants