TimeSeries-Plots mit Bokeh

Ich versuche, ein Timeseries Plot mit Kategorien zu zeichnen.

Xaxis_values: startTIme yaxis_values: count

  • Anzeige Höhe in Bokeh Vbar Tooltip
  • Bokeh "Quelle" mit verschiedenen Spalten Länge
  • Bokeh-Widget-Rückruf, um alle Checkboxen auszuwählen
  • Wie man eine Bokeh App mit verschiedenen Daten auf einem eingebetteten Bokeh Server wiederverwendet
  • Bokeh: Python: Kann keine HTML-Quelle für Bar-Plots in Bokeh bekommen
  • Bokeh überlagert mehrere Plotobjekte in einem GridPlot
  • Groupby: day

    Jeder Tag hat 24 Stunden Datensätze und so hat der gesamte Datensatz mehr als 100 Tage Ich versuche, nur wenige Arten von Plots zu haben.

    1. Gruppe nach day und Summe aller counts von jeder Stunde von startTime die 7 Zeitreihenplots in einem Graphen geben wird.

    2. Getrennt am Tag, dh jedes mon, tue, wed und so weiter, was auch immer die Anzahl der Tage n und plot eine 24 Stunden Zeitreihe.

    3. Gruppen nach Stunden unabhängig von Tagen. 00:00:00, 01:00:00 und so weiter

    Was ist der beste Weg, um die bessere Visualisierung mit Bokeh oder Seaborn zu bekommen.

    Eingang:

     2004-01-05,22:00:00,23:00:00,Mon,18944,790 2004-01-05,23:00:00,00:00:00,Mon,17534,750 2004-01-06,00:00:00,01:00:00,Tue,17262,747 2004-01-06,01:00:00,02:00:00,Tue,19072,777 2004-01-06,02:00:00,03:00:00,Tue,18275,785 2004-01-06,03:00:00,04:00:00,Tue,13589,757 2004-01-06,04:00:00,05:00:00,Tue,16053,735 2004-01-06,05:00:00,06:00:00,Tue,11440,636 2004-01-06,06:00:00,07:00:00,Tue,5972,513 2004-01-06,07:00:00,08:00:00,Tue,3424,382 2004-01-06,08:00:00,09:00:00,Tue,2696,303 2004-01-06,09:00:00,10:00:00,Tue,2350,262 2004-01-06,10:00:00,11:00:00,Tue,2309,254 

    Code: Referenz: Hier

     import numpy as np import pandas as pd from bokeh.charts import TimeSeries, show, output_file, vplot output_file("timeseries.html") data_one = pd.read_csv('one_hour.csv') data_one.columns = ['date', 'startTime', 'endTime', 'day', 'count', 'unique'] data = dict(data_one=data_one['count']) tsline = TimeSeries(data, x='startTime', y='count', color=['day'], title="Timeseries", ylabel='count', legend=True) show(vplot(tsline)) 

    Fehler:

     Traceback (most recent call last): File "date_graph.py", line 10, in <module> data = dict(data_one=data_one['count']) File "/usr/local/lib/python2.7/dist-packages/pandas/core/frame.py", line 1997, in __getitem__ return self._getitem_column(key) File "/usr/local/lib/python2.7/dist-packages/pandas/core/frame.py", line 2004, in _getitem_column return self._get_item_cache(key) File "/usr/local/lib/python2.7/dist-packages/pandas/core/generic.py", line 1350, in _get_item_cache values = self._data.get(item) File "/usr/local/lib/python2.7/dist-packages/pandas/core/internals.py", line 3290, in get loc = self.items.get_loc(item) File "/usr/local/lib/python2.7/dist-packages/pandas/indexes/base.py", line 1947, in get_loc return self._engine.get_loc(self._maybe_cast_indexer(key)) File "pandas/index.pyx", line 137, in pandas.index.IndexEngine.get_loc (pandas/index.c:4154) File "pandas/index.pyx", line 159, in pandas.index.IndexEngine.get_loc (pandas/index.c:4018) File "pandas/hashtable.pyx", line 675, in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:12368) File "pandas/hashtable.pyx", line 683, in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:12322) KeyError: 'count 

    Bearbeiten: Nach dem Ändern

     data = dict(data_one=data_one['count'].tolist()) 

    Fehler:

     Traceback (most recent call last): File "date_graph.py", line 12, in <module> tsline = TimeSeries(data, x='startTime', y='count', color=['startTime'], title="Timeseries", ylabel='count', legend=True) File "/usr/local/lib/python2.7/dist-packages/bokeh/charts/builders/timeseries_builder.py", line 102, in TimeSeries return create_and_build(builder_type, data, **kws) File "/usr/local/lib/python2.7/dist-packages/bokeh/charts/builder.py", line 67, in create_and_build chart.add_builder(builder) File "/usr/local/lib/python2.7/dist-packages/bokeh/charts/chart.py", line 149, in add_builder builder.create(self) File "/usr/local/lib/python2.7/dist-packages/bokeh/charts/builder.py", line 518, in create chart.add_renderers(self, renderers) File "/usr/local/lib/python2.7/dist-packages/bokeh/charts/chart.py", line 144, in add_renderers self.renderers += renderers File "/usr/local/lib/python2.7/dist-packages/bokeh/core/property_containers.py", line 18, in wrapper result = func(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/bokeh/core/property_containers.py", line 77, in __iadd__ return super(PropertyValueList, self).__iadd__(y) File "/usr/local/lib/python2.7/dist-packages/bokeh/charts/builders/line_builder.py", line 230, in yield_renderers x=group.get_values(self.x.selection), File "/usr/local/lib/python2.7/dist-packages/bokeh/charts/data_source.py", line 173, in get_values return self.data[selection] File "/usr/local/lib/python2.7/dist-packages/pandas/core/frame.py", line 1997, in __getitem__ return self._getitem_column(key) File "/usr/local/lib/python2.7/dist-packages/pandas/core/frame.py", line 2004, in _getitem_column return self._get_item_cache(key) File "/usr/local/lib/python2.7/dist-packages/pandas/core/generic.py", line 1350, in _get_item_cache values = self._data.get(item) File "/usr/local/lib/python2.7/dist-packages/pandas/core/internals.py", line 3290, in get loc = self.items.get_loc(item) File "/usr/local/lib/python2.7/dist-packages/pandas/indexes/base.py", line 1947, in get_loc return self._engine.get_loc(self._maybe_cast_indexer(key)) File "pandas/index.pyx", line 137, in pandas.index.IndexEngine.get_loc (pandas/index.c:4154) File "pandas/index.pyx", line 159, in pandas.index.IndexEngine.get_loc (pandas/index.c:4018) File "pandas/hashtable.pyx", line 675, in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:12368) File "pandas/hashtable.pyx", line 683, in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:12322) KeyError: 'startTime' 

  • Keras: Verwenden Sie die gleiche Schicht in verschiedenen Modellen (Aktiengewichte)
  • TensorFlow unter Windows installieren (Python 3.6.x)
  • Bild von erkanntem Objekt aus dem Bild mit Tensor-Flow speichern
  • Verstehen des LSTM-Modells mit Tensorflow für die Stimmungsanalyse
  • TensorFlow MNIST Beispiel läuft nicht mit full_connected_feed.py
  • Tensorflow softmax_cross ... () Funktion float type error
  • Python ist die beste Programmiersprache der Welt.