'module' object is not callable plotly quickfix

You may encounter this error while creating a candlestick chart using the Plotly library.

when I  was writing this code I faced the same TypeError and searched the web for the solution, positively I found the solution for it so I'm sharing that here, it may help you.


1 figure = go.Figure(
2     data = [
3              go.candlestick(
4                  x = df.index,
5                  low = df['Low'],
6                  high = df['High'],
7                  close = df['Close'],
8                 open = df['Open'],
9                 increasing_line_color = 'green',
10                 decreasing_line_color = 'red'
11            )
12      ]
13 )
14
15
16 figure.show()

In the 3rd line where I have written go.candlestick there I have written c in lowercase
because that was the suggestion given by Google Colab while writing the code, but if
I run this code I'm going to see TypeError that " 'module' object is not callable "

Now to fix this, all you need to do is replace that 'c' in the 3rd line from lowercase to uppercase.

go.Candlestick(

and now if you'll run your code you will not face any error.


Comments

Popular posts from this blog

Net Present Value (NPV) On Python Using Numpy

Commodity Channel Index ( CCI ) Using Python

SMA Trading Strategy Using Python