Nazhar commited on
Commit
928e08f
·
verified ·
1 Parent(s): 7572164

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -296,10 +296,10 @@ with news_analysis:
296
  plot_sub_neg = events[events['Negative_Impacts']!='']
297
  def get_set(list_value):
298
  set_value = set(list_value)
299
- return set_value
300
 
301
- plot_sub_pos['Feature'] = plot_sub_pos['Feature'].apply(get_set)
302
- plot_sub_neg['Feature'] = plot_sub_neg['Feature'].apply(get_set)
303
  # Create the line trace for stock prices
304
  line_stock = go.Scatter(x=events['Date'], y=events['Price'], mode='lines', name='OGDCL Close Price',
305
  line=dict(dash='solid', color=cs.close_line_color, width=2),
@@ -333,10 +333,10 @@ with news_analysis:
333
  figure = go.Figure(data=[line_stock], layout=layout)
334
  figure.add_scatter(x=plot_sub_pos['Date'], y=plot_sub_pos['Price'], mode='markers',
335
  marker=dict(symbol='triangle-up', size=10, color=cs.pos_impacts_color), name='Positive Impact',
336
- customdata=plot_sub_pos['Feature'], hovertemplate='%{x}<br>Close: %{y}<br>Feature: %{customdata}<br>')
337
  figure.add_scatter(x=plot_sub_neg['Date'], y=plot_sub_neg['Price'], mode='markers',
338
  marker=dict(symbol='triangle-down', size=10, color=cs.neg_impacts_color), name='Negative Impact',
339
- customdata=plot_sub_neg['Feature'], hovertemplate='%{x}<br>Close: %{y}<br>Feature: %{customdata}<br>',)
340
  figure.update_layout(
341
  title={
342
  'text': title,
@@ -727,10 +727,10 @@ with final_recs:
727
  figure = go.Figure(data=[line_stock], layout=layout)
728
  figure.add_scatter(x=plot_sub_pos['Date'], y=plot_sub_pos['Price'], mode='markers',
729
  marker=dict(symbol='triangle-up', size=10, color=cs.pos_impacts_color), name='Positive Impact',
730
- customdata=plot_sub_pos['Feature'], hovertemplate='%{x}<br>Close: %{y}<br>Feature: %{customdata}<br>')
731
  figure.add_scatter(x=plot_sub_neg['Date'], y=plot_sub_neg['Price'], mode='markers',
732
  marker=dict(symbol='triangle-down', size=10, color=cs.neg_impacts_color), name='Negative Impact',
733
- customdata=plot_sub_neg['Feature'], hovertemplate='%{x}<br>Close: %{y}<br>Feature: %{customdata}<br>',)
734
  figure.update_layout(
735
  title={
736
  'text': title,
 
296
  plot_sub_neg = events[events['Negative_Impacts']!='']
297
  def get_set(list_value):
298
  set_value = set(list_value)
299
+ return str(set_value)
300
 
301
+ plot_sub_pos['SetFeature'] = plot_sub_pos['SetFeature'].apply(get_set)
302
+ plot_sub_neg['SetFeature'] = plot_sub_neg['SetFeature'].apply(get_set)
303
  # Create the line trace for stock prices
304
  line_stock = go.Scatter(x=events['Date'], y=events['Price'], mode='lines', name='OGDCL Close Price',
305
  line=dict(dash='solid', color=cs.close_line_color, width=2),
 
333
  figure = go.Figure(data=[line_stock], layout=layout)
334
  figure.add_scatter(x=plot_sub_pos['Date'], y=plot_sub_pos['Price'], mode='markers',
335
  marker=dict(symbol='triangle-up', size=10, color=cs.pos_impacts_color), name='Positive Impact',
336
+ customdata=plot_sub_pos['SetFeature'], hovertemplate='%{x}<br>Close: %{y}<br>Feature: %{customdata}<br>')
337
  figure.add_scatter(x=plot_sub_neg['Date'], y=plot_sub_neg['Price'], mode='markers',
338
  marker=dict(symbol='triangle-down', size=10, color=cs.neg_impacts_color), name='Negative Impact',
339
+ customdata=plot_sub_neg['SetFeature'], hovertemplate='%{x}<br>Close: %{y}<br>Feature: %{customdata}<br>',)
340
  figure.update_layout(
341
  title={
342
  'text': title,
 
727
  figure = go.Figure(data=[line_stock], layout=layout)
728
  figure.add_scatter(x=plot_sub_pos['Date'], y=plot_sub_pos['Price'], mode='markers',
729
  marker=dict(symbol='triangle-up', size=10, color=cs.pos_impacts_color), name='Positive Impact',
730
+ customdata=plot_sub_pos['SetFeature'], hovertemplate='%{x}<br>Close: %{y}<br>Feature: %{customdata}<br>')
731
  figure.add_scatter(x=plot_sub_neg['Date'], y=plot_sub_neg['Price'], mode='markers',
732
  marker=dict(symbol='triangle-down', size=10, color=cs.neg_impacts_color), name='Negative Impact',
733
+ customdata=plot_sub_neg['SetFeature'], hovertemplate='%{x}<br>Close: %{y}<br>Feature: %{customdata}<br>',)
734
  figure.update_layout(
735
  title={
736
  'text': title,