ReactiveX / RxPY

ReactiveX for Python

Home Page:https://rxpy.rtfd.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Question] Reading/writing from/to a Pandas DataFrame in rxpy

KickItLikeShika opened this issue · comments

It's my first time to use rxpy, and i have been struggling a bit to read data from a csv file and then save it again into a csv file, i always use pandas to deal with csv's (if someone has a better way to deal with csv's in rxpy please share it!).

data = from_(pd.read_csv("dataset.csv").itertuples(index=False))
output = data.pipe(
        op.filter(lambda row: is_good_sample(row))
    ).subscribe(
        on_completed=print("done")
    )

now i want to access the filtered items to store the output again in a csv file, how can i do that? and is there a better way to do this?

just realized how this should work, thanks!

I you're doing data transforms with rxpy you might be interested in makinage and rxcsi. It contains operators that complement rxpy and some operators to convert an observable from and to pandas.