Even though, I dump my Dataframe to CSV and read load dumped CSV using pd.read_csv('file', **encoding** = "**ISO**-8859-1")
. It doesn’t work too.
Issue is in “components()” of bokeh. It is doing something strange.
Error:
Traceback (most recent call last):
File “modules/data_profiling_sql/layout/populate_in_html.py”, line 342, in populate_plots_data
script, plots = components(plot_data)
File “/usr/local/lib/python2.7/dist-packages/bokeh/embed.py”, line 233, in components
(docs_json, render_items) = _standalone_docs_json_and_render_items(models)
File “/usr/local/lib/python2.7/dist-packages/bokeh/embed.py”, line 747, in _standalone_docs_json_and_render_items
docs_json[k] = v.to_json()
File “/usr/local/lib/python2.7/dist-packages/bokeh/document.py”, line 734, in to_json
doc_json = self.to_json_string()
File “/usr/local/lib/python2.7/dist-packages/bokeh/document.py”, line 763, in to_json_string
return serialize_json(json, indent=indent)
File “/usr/local/lib/python2.7/dist-packages/bokeh/core/json_encoder.py”, line 226, in serialize_json
return json.dumps(obj, cls=BokehJSONEncoder, allow_nan=False, indent=indent, separators=separators, sort_keys=True, **kwargs)
File “/usr/lib/python2.7/json/init.py”, line 251, in dumps
sort_keys=sort_keys, **kw).encode(obj)
File “/usr/lib/python2.7/json/encoder.py”, line 209, in encode
chunks = list(chunks)
File “/usr/lib/python2.7/json/encoder.py”, line 434, in _iterencode
for chunk in _iterencode_dict(o, _current_indent_level):
File “/usr/lib/python2.7/json/encoder.py”, line 408, in _iterencode_dict
for chunk in chunks:
File “/usr/lib/python2.7/json/encoder.py”, line 408, in _iterencode_dict
for chunk in chunks:
File “/usr/lib/python2.7/json/encoder.py”, line 332, in _iterencode_list
for chunk in chunks:
File “/usr/lib/python2.7/json/encoder.py”, line 408, in _iterencode_dict
for chunk in chunks:
File “/usr/lib/python2.7/json/encoder.py”, line 408, in _iterencode_dict
for chunk in chunks:
File “/usr/lib/python2.7/json/encoder.py”, line 408, in _iterencode_dict
for chunk in chunks:
File “/usr/lib/python2.7/json/encoder.py”, line 313, in _iterencode_list
yield buf + _encoder(value)
UnicodeDecodeError: ‘utf8’ codec can’t decode byte 0xc3 in position 19: unexpected end of data
Process finished with exit code 1
This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient. Any review, use, distribution, or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message.
···
On Tue, Sep 19, 2017 at 4:32 PM, Nitin Solanki [email protected] wrote:
I’m not using CSV.
I created by own pandas DataFrame without CSV.
On Tue, Sep 19, 2017 at 4:26 PM, Hiram Foster [email protected] wrote:
When loading your df, try pd.read_csv('file', **encoding** = "**ISO**-8859-1")
(Adjusting for your source and file name).
–
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/CAO0BaO1EaVRSNbVwoPkk%2B3f1NC%2BO9SnQ_Uki0RybFoP8KxX31Q%40mail.gmail.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.
On Sep 19, 2017 6:02 AM, “Nitin Solanki” [email protected] wrote:
Hello,
My pandas Dataframe contains below characters.
Names
Kiljavan Lääketutkimus
Centre Hospitalier Régional Universitaire de Montpellier
Hospital Regional Universitario de Málaga
Akdeniz Üniversitesi Hastanesi
MVZ für Rheumatologie Dr. Martin Welcker
During rendering this dataframe to bokeh charts.
It throws error - “UnicodeDecodeError: ‘utf8’ codec can’t decode byte 0xc3 in position 19: unexpected end of data”
I tried
df[“names”] = df[“names”].apply(lambda x: x.decode(‘unicode_escape’).encode(‘ascii’, ‘replace’).strip())
but it is ignore UTF-8 Characters that i dont’ want. I need to keep data intact
Any help ?
Nitin
This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient. Any review, use, distribution, or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message.
–
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/CAOUEs4UfBT1f1a7hA8oUk5eOf5-Tm%3D-9–mY2A0GCQVOgVgYrg%40mail.gmail.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.