I need help in the course python finance question 11.1 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 3

I need help in the course python finance question 11.1

I can't do the project there is a certain error

8th Jan 2022, 5:25 PM
magdaldin Ibrahim
22 Answers
+ 3
Thx for the help
8th Jan 2022, 7:16 PM
magdaldin Ibrahim
+ 1
Thanks for the help 🥰
9th Jan 2022, 10:01 AM
Shubham Bhatia
Shubham Bhatia - avatar
0
What is the "certain error"? Please explain the problem.
8th Jan 2022, 5:40 PM
Lisa
Lisa - avatar
0
It's an name error it says the "plt" name isn't usable
8th Jan 2022, 5:45 PM
magdaldin Ibrahim
0
But in the example they used it and it worked
8th Jan 2022, 5:45 PM
magdaldin Ibrahim
0
Please link your code
8th Jan 2022, 5:50 PM
Lisa
Lisa - avatar
0
Ok
8th Jan 2022, 5:51 PM
magdaldin Ibrahim
0
import numpy as np import numpy_financial as npf #price for 2018-2021 bitcoin = [3869.47, 7188.46, 22203.31, 29391.78] print (np.std(bitcoin)) npf.irr(bitcoin ) plt .plot(bitcoin) plt .savefig('plot.png')
8th Jan 2022, 5:52 PM
magdaldin Ibrahim
0
Here
8th Jan 2022, 5:52 PM
magdaldin Ibrahim
0
You forgot to import matplotlib.pyplot as plt.
8th Jan 2022, 5:55 PM
Lisa
Lisa - avatar
0
So I write that in the beginning
8th Jan 2022, 5:55 PM
magdaldin Ibrahim
0
So thats a variable?
8th Jan 2022, 5:56 PM
magdaldin Ibrahim
0
plt=matplotlib.plt is this right?
8th Jan 2022, 5:57 PM
magdaldin Ibrahim
0
No, it is not a variable, it's importing a module. plt is the short name for matplotlib.pyplot. Look at the example codes in the lessons again
8th Jan 2022, 5:58 PM
Lisa
Lisa - avatar
0
Ok thank you
8th Jan 2022, 5:59 PM
magdaldin Ibrahim
0
I did it this is the right way
8th Jan 2022, 6:02 PM
magdaldin Ibrahim
0
import numpy as np import numpy_financial as npf #price for 2018-2021 bitcoin = [3869.47, 7188.46, 22203.31, 29391.78] print (np.std(bitcoin)) npf.irr(bitcoin ) import matplotlib.pyplot as plt plt .plot(bitcoin) plt .savefig('plot.png')
8th Jan 2022, 6:02 PM
magdaldin Ibrahim
0
import numpy as np import numpy_financial as npf import matplotlib.pyplot as plt # YOU SHOULD ALWAYS IMPORT YOUR LIBRARIES AT THE TOP TO AVOID BUGS #price for 2018-2021 bitcoin = [3869.47, 7188.46, 22203.31, 29391.78] print (np.std(bitcoin)) npf.irr(bitcoin ) plt .plot(bitcoin) plt .savefig('plot.png') HOPE IT HELPS CHECK MY COMMENT AT THE TOP OF THE SNIPPET
8th Jan 2022, 7:15 PM
Fredkishala
Fredkishala - avatar
0
I need help alsk with the sum of 5-6 question to multiply with 57.3 im gives me error
9th Jan 2022, 5:47 PM
Pietro Miccoli
0
The finance course
9th Jan 2022, 6:38 PM
magdaldin Ibrahim