questions about using rect to create bar which is interactive

I tried to use rect to create bar chart which is interactive by widgets, I have my x_axis data stored in a CSV file, and it seems that the rect’s x_axis must be array or list, how can I transform them.

在 2016年6月4日星期六 UTC+8下午7:44:27,Qiwei Peng写道:

···

I tried to use rect to create bar chart which is interactive by widgets, I have my x_axis data stored in a CSV file, and my x data is string(location), it seems that the rect’s x_axis must be array or list, how can I transform them.

Your question is too vague. Transform them to what? Please provide some example code of wgat exactly you have tried.

Thanks,

Bryan

···

On Jun 4, 2016, at 06:44, Qiwei Peng [email protected] wrote:

I tried to use rect to create bar chart which is interactive by widgets, I have my x_axis data stored in a CSV file, and it seems that the rect’s x_axis must be array or list, how can I transform them.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/d25fd4a0-600e-4d09-8b17-558293b80f9e%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

I am sorry for my poor English expression…and my codes are too messy

I wish to use rect to create bar, my data is a CSV file, stored in a pandas dataframe, I can’t use them as rect’s axis data(my x data is string(locations)), how can i transmit them into x_range

this is my data:df

i wish these values to be my rect’s x data:df[“location”]

but i’ve got a problem on transforming df[“location”] into an array or a list, df[“location”] has no ‘,’ rows

在 2016年6月4日星期六 UTC+8下午8:06:26,Bryan Van de ven写道:

···

Your question is too vague. Transform them to what? Please provide some example code of wgat exactly you have tried.

Thanks,

Bryan

On Jun 4, 2016, at 06:44, Qiwei Peng [email protected] wrote:

I tried to use rect to create bar chart which is interactive by widgets, I have my x_axis data stored in a CSV file, and it seems that the rect’s x_axis must be array or list, how can I transform them.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/d25fd4a0-600e-4d09-8b17-558293b80f9e%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Your English is perfectly fine, it's just a matter of needing as much information as possible to quickly provide help. Regarding pandas data frame columns, you can just pass them directly to rect, the glyph methods accept most any iterable type. There is an example here that uses dataframes with line (in stead of rect, but the principle is the same):

  https://github.com/bokeh/bokeh/blob/master/examples/plotting/file/stocks.py

Thanks,

Bryan

···

On Jun 4, 2016, at 8:30 AM, Qiwei Peng <[email protected]> wrote:

I am sorry for my poor English expression.......and my codes are too messy

I wish to use rect to create bar, my data is a CSV file, stored in a pandas dataframe, I can't use them as rect's axis data(my x data is string(locations)), how can i transmit them into x_range

this is my data:df
i wish these values to be my rect's x data:df["location"]
but i've got a problem on transforming df["location"] into an array or a list, df["location"] has no ',' rows

在 2016年6月4日星期六 UTC+8下午8:06:26,Bryan Van de ven写道:
Your question is too vague. Transform them to what? Please provide some example code of wgat exactly you have tried.

Thanks,

Bryan

On Jun 4, 2016, at 06:44, Qiwei Peng <[email protected]> wrote:

I tried to use rect to create bar chart which is interactive by widgets, I have my x_axis data stored in a CSV file, and it seems that the rect's x_axis must be array or list, how can I transform them.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+un...@continuum.io.
To post to this group, send email to bo...@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/d25fd4a0-600e-4d09-8b17-558293b80f9e%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/177bb0cc-5230-4cc3-bae5-62a2bf7ea31c%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.