1

Currently my data set is in the format: Date, Currency, Price which I am filtering at Currency level and then using it to generate graphs.

I want to improve it so that all the filtering is done using Python widget/Dropdown boxes?

I'm new to Python/Bokeh so I need some help.

Date      Currency    Price
1/1/2017  AUDUSD      1.01
2/1/2017  AUDUSD      1.02
3/1/2017  AUDUSD      1.03
1/1/2017  USDJPY      1.01
2/1/2017  USDJPY      1.02
3/1/2017  USDJPY      1.03
1/1/2017  CADUSD      1.01
2/1/2017  CADUSD      1.02
3/1/2017  CADUSD      1.03
4
  • Any luck on this problem please? Commented Oct 13, 2017 at 19:45
  • There are a multitude of examples to get you started with this. See the docs , in particular examples or this question or this one, amongst others. Commented Oct 14, 2017 at 5:49
  • I used this sample stackoverflow.com/questions/46420266/… The problem is my code runs smoothly but doesn't generate any graph. Commented Oct 14, 2017 at 15:56
  • Got this sorted!!! Thanks Commented Oct 14, 2017 at 18:20

1 Answer 1

0
#Creating CCyPair wise menu
menu = Select(options=['AUDUSD','USDJPY'], value='AUDUSD')
#Function for dataframe
def get_all_price_dataset(src,name):
  df = src[(src.CCYPair == name) & (src.TYPE == 'Prices')].copy()
  return df
# Function to update Plot
def update_plot(attrname, old, new):
  newccy = menu.value
  side = buysellmenu.value
  datevalue = datemenu.value
  src_data_table = 
  ColumnDataSource(get_all_dataset(Combined,newccy,side,datevalue))
  DisplayData.data.update(src_data_table.data)
  #On change in menu,function gets called.
  menu.on_change('value', update_plot)
  #Displaying Menu and Plot.
  layout = layout([menu],
                  [plot])
  curdoc().add_root(layout)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.