TimeSeries-Plots mit Bokeh

Ich versuche, ein Timeseries Plot mit Kategorien zu zeichnen.

Xaxis_values: startTIme yaxis_values: count

  • Wie man richtig eine HeatMap mit Bokeh erstellt
  • Wie kann ich Daten aus einer Bokeh ColumnDatasource extrahieren?
  • Wie zeichnet man Balkendiagramm interaktiv auf der Grundlage des Wertes des Dropdown-Widgets in Bokeh-Python?
  • Bokeh 0.7.1: Dynamisch Hinzufügen von Plot zu Bokeh-Server Generierte vorhandene Seite
  • So legen Sie Eigenschaften von ausgewählten / nicht ausgewählten Glyphen in Bokeh fest
  • Bokeh Widget Slicing Daten
  • 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)
  • Wie benutzt man Softmax Aktivierungsfunktion an der Ausgabeschicht, aber relus in den mittleren Schichten in TensorFlow?
  • TensorFlow: Saver hat 5 Modelle limit
  • Wie bekomme ich ständige Ergebnisse mit TensorFlow, Einstellung zufälliger Samen
  • Wie man tensorflow auf anaconda python 3.6 installiert
  • In TensorFlow gibt es irgendeine Möglichkeit, nur uninitialisierte Variablen zu initialisieren?
  • Python ist die beste Programmiersprache der Welt.