Use `np.full`
oyamad opened this issue · comments
Daisuke Oyama commented
Shu Hu commented
Thanks @oyamad .
Hi @oyamad and @jstac , next I will
- identify the pattern
np.ones * alpha
through all advanced lectures, - list related lectures and
- create a PR to modify this pattern to the
np.full
version.
The pattern np.ones * alpha
appears in the following lectures (call the following list 1):
amss
amss3
arellano
calvo
rosen_schooling_model
smoothing_tax
smoothing
Except those above, I also identify the np.ones
pattern in the following lectures and do you think we should modify these as well (call the following list 2)?
additive_functionals
:nx1 = np.ones(nx)
amss2
:c1, c2 = fsolve(equations, np.ones(2), args=(Φ))
discrete_dp
:# data = np.ones(L)
dyn_stack
:βs = np.ones(n)
lucas_model
:f = np.ones_like(grid) # Initial guess of f
opt_tax_recur
:tax_seq = SequentialLS(CRRAutility(), g=np.array([0.15]), π=np.ones((1, 1)))
Daisuke Oyama commented
There are a few more in some .py
files:
- https://github.com/QuantEcon/lecture-python-advanced.myst/blob/main/lectures/_static/lecture_specific/amss2/log_utility.py
- https://github.com/QuantEcon/lecture-python-advanced.myst/blob/main/lectures/_static/lecture_specific/amss2/crra_utility.py
- https://github.com/QuantEcon/lecture-python-advanced.myst/blob/main/lectures/_static/lecture_specific/opt_tax_recur/sequential_allocation.py
- https://github.com/QuantEcon/lecture-python-advanced.myst/blob/main/lectures/_static/lecture_specific/amss2/sequential_allocation.py
- https://github.com/QuantEcon/lecture-python-advanced.myst/blob/main/lectures/_static/lecture_specific/opt_tax_recur/recursive_allocation.py
- https://github.com/QuantEcon/lecture-python-advanced.myst/blob/main/lectures/_static/lecture_specific/amss2/recursive_allocation.py