-
-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
183 changed files
with
90,727 additions
and
543 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Using FinancePy in a Jupyter Notebook | ||
|
||
Once financepy has been installed, it is easy to get started. | ||
|
||
Just download the project and examine the set of Jupyter Notebooks in this notebooks folder. | ||
|
||
These have been organised according to the same directory structure as the project. | ||
|
||
A pdf manual describing all of the functions can be found in the project directory. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
del /S ERROR_*.ipynb |
287 changes: 287 additions & 0 deletions
287
book/ALL FINANCEPY/finutils/FINCALENDAR_IntroductionToUsingCalendars.ipynb
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,287 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# USING CALENDARS" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from financepy.utils import *" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"We can see what calendars are available" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"CalendarTypes.NONE\n", | ||
"CalendarTypes.WEEKEND\n", | ||
"CalendarTypes.AUSTRALIA\n", | ||
"CalendarTypes.CANADA\n", | ||
"CalendarTypes.FRANCE\n", | ||
"CalendarTypes.GERMANY\n", | ||
"CalendarTypes.ITALY\n", | ||
"CalendarTypes.JAPAN\n", | ||
"CalendarTypes.NEW_ZEALAND\n", | ||
"CalendarTypes.NORWAY\n", | ||
"CalendarTypes.SWEDEN\n", | ||
"CalendarTypes.SWITZERLAND\n", | ||
"CalendarTypes.TARGET\n", | ||
"CalendarTypes.UNITED_STATES\n", | ||
"CalendarTypes.UNITED_KINGDOM\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"for e in CalendarTypes:\n", | ||
" print(e)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Holiday Lists" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 6, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Specify US holiday calendar\n", | ||
"calUS = Calendar(CalendarTypes.UNITED_STATES)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 7, | ||
"metadata": { | ||
"scrolled": false | ||
}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"['01-JAN-2019',\n", | ||
" '21-JAN-2019',\n", | ||
" '18-FEB-2019',\n", | ||
" '27-MAY-2019',\n", | ||
" '04-JUL-2019',\n", | ||
" '02-SEP-2019',\n", | ||
" '14-OCT-2019',\n", | ||
" '11-NOV-2019',\n", | ||
" '28-NOV-2019',\n", | ||
" '25-DEC-2019']" | ||
] | ||
}, | ||
"execution_count": 7, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"calUS.get_holiday_list(2019)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 8, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Specify UK holiday calendar\n", | ||
"calUK = Calendar(CalendarTypes.UNITED_KINGDOM)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 9, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"['01-JAN-2019',\n", | ||
" '19-APR-2019',\n", | ||
" '22-APR-2019',\n", | ||
" '06-MAY-2019',\n", | ||
" '27-MAY-2019',\n", | ||
" '26-AUG-2019',\n", | ||
" '25-DEC-2019',\n", | ||
" '26-DEC-2019']" | ||
] | ||
}, | ||
"execution_count": 9, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"calUK.get_holiday_list(2019)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 10, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Specify EUROPEAN TARGET holiday calendar\n", | ||
"calEU = Calendar(CalendarTypes.TARGET)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 11, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"['01-JAN-2019',\n", | ||
" '19-APR-2019',\n", | ||
" '22-APR-2019',\n", | ||
" '01-MAY-2019',\n", | ||
" '25-DEC-2019',\n", | ||
" '26-DEC-2019']" | ||
] | ||
}, | ||
"execution_count": 11, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"calEU.get_holiday_list(2019)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Easter Monday" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 12, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"22-APR-2019\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"print(calEU.easter_monday(2019))" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 13, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"02-APR-2018\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"print(calEU.easter_monday(2018))" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 14, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"17-APR-2017\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"print(calEU.easter_monday(2017))" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 15, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"28-MAR-2016\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"print(calEU.easter_monday(2016))" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Copyright (c) 2020 Dominic O'Kane" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.13" | ||
}, | ||
"vscode": { | ||
"interpreter": { | ||
"hash": "bf723d6cfadaef99605cbe395b066743a854874e8c7ea88f8e08ad90fcfaf87e" | ||
} | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
Oops, something went wrong.