quantecon / quantecon-notebooks-datascience Goto Github PK
View Code? Open in Web Editor NEWJupyter Notebooks for https://datascience.quantecon.org
Jupyter Notebooks for https://datascience.quantecon.org
After installation with recommend ! pip install qeds
in Google Colab (Python3), I get some strange recursion errors, always variation on the same theme:
import qeds
qeds.themes.mpl_style();
---------------------------------------------------------------------------
RecursionError Traceback (most recent call last)
<ipython-input-16-72b73e412c56> in <module>()
5 # activate plot theme
6 import qeds
----> 7 qeds.themes.mpl_style();
1 frames
/usr/local/lib/python3.6/dist-packages/qeds/themes.py in mpl_style()
49 rcp['axes.labelsize'] = 'large'
50
---> 51 plt.style.library["qeds"] = mpl_style()
52 plt.style.reload_library()
53 plt.style.use("qeds")
... last 1 frames repeated, from the frame below ...
/usr/local/lib/python3.6/dist-packages/qeds/themes.py in mpl_style()
49 rcp['axes.labelsize'] = 'large'
50
---> 51 plt.style.library["qeds"] = mpl_style()
52 plt.style.reload_library()
53 plt.style.use("qeds")
RecursionError: maximum recursion depth exceeded in comparison
Lines 179-181 in the source blob of quantecon-notebooks-datascience/python_fundamentals/control_flow.ipynb
read:
"Note that we can also consider an asset that lives and pays forever if\n",
"$ T= \infty $, and from (2), the value of an asset which\n",
"pays 1 forever is $ \frac{r}{1+r} $."
when in fact the infinite series associated with an asset that pays 1 forever converges to $ \frac{1+r}{r} > 1$, assuming $ r \geq 0 $.
Am I missing something? If not, I kindly request that someone fix this issue.
pandas/basics.ipynb applies pct_change()
without arguments.
Is it better to mention the behavior of pct_change()
in case there are missing values? The default behavior is padding if there is any missing data. Need to use pct_change(fill_method=None)
if anyone wants the percentage to be missing.
Below is an example:
import pandas as pd
import numpy as np
df = pd.DataFrame({'x': [1, 2, np.nan, 3, 4]})
df
output:
x
0 1.0
1 2.0
2 NaN
3 3.0
4 4.0
df.pct_change()
output:
x
0 NaN
1 1.000000
2 0.000000
3 0.500000
4 0.333333
df.pct_change(fill_method=None)
output:
x
0 NaN
1 1.000000
2 NaN
3 NaN
4 0.333333
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.