[Q] stream asyncio dataframes to_dataframe usage

Abierto
#177 0 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
pandas, python

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
1.3k
Forks
149
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de python-streamz/streamz

Todos los issues de python-streamz/streamz

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.