0

I've got a web server (tornado), and want to serialize a large dataframe to json but chunk by chunk, not creating the whole json string then sending it.

Is that possible ?

JulienFr
  • 2,017
  • 2
  • 22
  • 33

1 Answers1

0

The http server (tornado) implements so this works :

import tornado.ioloop
import tornado.web
impot pandas as pd

df=pf.DataFrame({"test":[1,2,3,4]})

class MainHandler(tornado.web.RequestHandler):
    def get(self):
        df.to_json(self)
JulienFr
  • 2,017
  • 2
  • 22
  • 33