Open spfeifer222 opened 3 years ago
Hi @spfeifer222,
I can reproduce the error. Could you provide me a minimal code example for debugging please?
Thanks for reporting the bug
Best Patrik
Dear @PatrikHlobil ,
today I took time to have a closer look at the problem.
My observations:
float64
, where any of the integer
datatypes should be used. But however, this should not lead to fail printing the data correctly. I guess this is not problem, but I added this for your information. NaN
values in the data, which seems to be completely ignored instead of concidering as 0
(zero). I don't now if this would be the same in the original bokeh
module. Could you tell me, if this is the case? The problem seems to be worse, if the first column contains a NaN
value. In this case the hole row is completely ignored.The NaN
and float64
-type values have been created by pd.concat
whIle concatening dataframes (with integer
values only).
From these observations I constructed the following minimal example:
import numpy as np
import pandas as pd
import pandas_bokeh
df_test = pd.DataFrame([[np.nan, 1.0], [2.0, np.nan], [2.0, 1.0]],
columns=['Handelsname', 'anderer'])
df_test.plot_bokeh.bar(ylabel='Anzahl',
xlabel='Länge',
vertical_xlabel=True,
stacked=True,
title='Produktnamen',
fill_alpha=0.7)
Of course this problem could be solved by proper datatype handling, but vor convenience it would be great, if pandas_bokeh
would be robust in such cases.
The folloing code does the job. Maybe you could include it as pre-processing in `plot_bokeh.bar()' function.
df_corr = df_test.fillna(0).astype('int64')
df_corr.plot_bokeh.bar(ylabel='Anzahl',
xlabel='Länge',
vertical_xlabel=True,
stacked=True,
title='Produktnamen',
fill_alpha=0.7)
see html below. this seems to be a bug