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 ?

julienfr112
  • 2,077
  • 2
  • 25
  • 37

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)
julienfr112
  • 2,077
  • 2
  • 25
  • 37