Argparse doesn't support date arguments by default, but it can be easily extended to parse and validate dates in your Python scripts.
Category: Python
Using requests and BeautifulSoup in Python to scrape data
Sometimes pandas.read_html doesn't work for scraping website data, but you can try using requests and BeautifulSoup to do it yourself.
Analyzing intraday and overnight stock returns with pandas
There are big differences between overnight and intraday stock returns. This article shows how to use pandas to understand one big reason.
Analyzing stock data near events with pandas
Stock returns can be heavily impacted by certain events. Sometimes these events are unexpected or a surprise (natural disasters, global pandemics, terrorism) and other times they are scheduled (presidential elections, earnings announcements, financial data releases). We can use pandas to obtain financial data and see the impacts of events the returns of stocks. In my … Continue reading Analyzing stock data near events with pandas
Financial market data analysis with pandas
Pandas is a great tool for time series analysis of financial market data. Because pandas DataFrames and Series work well with a date/time based index, they can be used effectively to analyze historical data. By financial market data, I mean data like historical price information on a publicly traded financial instrument. However, any sort of … Continue reading Financial market data analysis with pandas
Jupytext – Jupyter notebooks as Markdown documents or Python scripts
Jupytext is a Jupyter plugin that allows you to convert Jupyter notebooks to Markdown or Python script files and back again.
Version control for Jupyter notebooks
Jupyter notebooks are hard to diff and merge since they contain both code and output, but tools and practices can make version control easier.
Building Jupyter notebook workflows with scrapbook
The scrapbook library allows you to save state inside the notebook file itself, making it easier to develop workflows using Jupyter notebooks.
Parameterizing and automating Jupyter notebooks with papermill
Have you ever created a Jupyter notebook and wished you could generate the notebook with a different set of parameters? If so, you've probably done at least one of the following: Edited the variables in a cell and reran the notebook, saving off a copy as neededSaved a copy of the notebook and maybe hacked … Continue reading Parameterizing and automating Jupyter notebooks with papermill
Indexing time series data in pandas
Indexing time series data in pandas is similar to other types, but there are a number of convenient functions unique to time series.