Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added timeseries to dataframes that return a date #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bdaniels22
Copy link

@bdaniels22 bdaniels22 commented Feb 13, 2021

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")`

Copy link

@ckardatzke ckardatzke left a comment

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