Comments (1)
Hi Aly. Here are some suggestions:
- Don't use
map
. Use vectorization usingnumpy
as we discussed. (numpy's 'ufuncs') - Try simplifying the problem to understand the error. You'll see that
new
is a generator and not a list.
Compare
def pdf(x):
a = x**2
return a
grid = np.linspace(-5, 5, num= 20)
new = map(pdf, grid)
plt.plot(grid, new, 'k-', linewidth=2)
plt.show()
with
def pdf(x):
a = x**2
return a
grid = np.linspace(-5, 5, num= 20)
new = list(map(pdf, grid))
plt.plot(grid, new, 'k-', linewidth=2)
plt.show()
After running new = map(pdf, grid)
, you'll see this:
- Don't use
math.exp
ormath.log
. Usenp.exp
andnp.log
. This will help you so that you don't have to usemap
.
Let me know if this helps!
from comp-econ-sp18.
Related Issues (20)
- Behavior of np.sum on pandas dataframes HOT 1
- Does TIRE enter into Variable profits? HOT 3
- q4- how to compare without alpha_4 HOT 1
- SQL Assignment: issue with timestamps HOT 1
- Bresnahan Reiss Q2 HOT 4
- When is pset 7 due? HOT 1
- Intercept in Fixed Effects Models? HOT 1
- How to convert strings to float in R? HOT 5
- R packages tidyr and dplyr installation problems HOT 1
- Chipotle R HW HOT 3
- R error in fixed effects: Error: inherits(object, "formula") is not TRUE HOT 3
- R equivalent of .info? HOT 1
- When do you need the effect keywork in plm() ? HOT 1
- Different results depending on order of variables for covariance matrix? HOT 1
- linear models regressions Q4 HOT 11
- Fixed Effects Q2 HOT 2
- Fixed effects using OLS vs linearmodels HOT 6
- Midterm Solutions HOT 1
- Visualization with Python
- Last Minute Office Hours HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from comp-econ-sp18.