I'm trying to def a functin but i can't call it:
def test():
fig = make_subplots(rows=1, cols=2, specs=[
[{'type': 'scatter'}, {'type': 'table'}]]
, shared_xaxes=True,
horizontal_spacing=0.05,
vertical_spacing=0.05,
column_widths=[0.7, 0.3])
pass
test()
fig.add_trace(go.Candlestick(x=df.index,
open=df['Open'],
high=df['High'],
low=df['Low'],
close=df['Close'],
increasing_line_color = UP_CANDLE,
decreasing_line_color = DW_CANDLE),row=1,col=1)
When I call it I retrieve the following error: NameError: name 'fig' is not defined If I remove the function, the code works perfectly.