- 3

# I need help in the course python finance question 11.1

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

22 Answers

+ 3

Thx for the help

+ 1

Thanks for the help π₯°

0

What is the "certain error"? Please explain the problem.

0

It's an name error it says the "plt" name isn't usable

0

But in the example they used it and it worked

0

Please link your code

0

Ok

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')

0

Here

0

You forgot to import matplotlib.pyplot as plt.

0

So I write that in the beginning

0

So thats a variable?

0

plt=matplotlib.plt is this right?

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

0

Ok thank you

0

I did it this is the right way

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')

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

0

I need help alsk with the sum of 5-6 question to multiply with 57.3 im gives me error

0

The finance course