[Q] stream asyncio dataframes to_dataframe usage

Aperta
#177 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
pandas, python

Direzione di ricerca

Start by reproducing the supplied coroutine using Stream.to_dataframe, source.emit(readField()), and sdf.tail(). Inspect the to_dataframe path and asynchronous emission behavior to determine why the resulting dataframe is empty. Done means the behavior is explained and, if it is a defect, covered by a focused regression test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Hey guys,

Great work here, I just have a problem understanding how we translate a stream of dataframe so we can use tail() etc.

I have a coroutine, that emits dataframes to my stream.

from streamz import Stream
from tornado.ioloop import IOLoop

@gen.coroutine
def f():
    source = Stream(asynchronous=True)  # tell the stream we're working asynchronously
    example = pd.DataFrame({'x': []})
    sdf = source.to_dataframe(example=example)
    for x in range(10):
        yield gen.sleep(0.1)
        yield source.emit(readField())
    sdf.tail()
    sdf.cumsum()
    print(sdf)

IOLoop().run_sync(f)

with:

@asyncio.async
def readField():
    """ 
    asynchronously - Blocking IO operation
    """
    df = pd.DataFrame({'x': [SomeValues]})
    return df

As output I get:

DataFrame - elements like:
Empty DataFrame
Columns: [x]
Index: []

I am not sure if thats the way we are looking to use the to_DataFrame.

I basically want to send my dataframes to a stream, translate it to bigger dataframes (window etc.) and perform some dynamic printing on the resulting frames. But somehow it seems, that my data is not transmitted to my stream.

Any idea/help would be appreciated.

Lingua principale
Python
Stelle
1.3k
Fork
149
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di python-streamz/streamz

Tutte le issue di python-streamz/streamz

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.