Skip to content

Instantly share code, notes, and snippets.

@about36km
Created December 25, 2017 01:23
Show Gist options
  • Select an option

  • Save about36km/2b13924baf3d5d75e90d2e8aca8aa035 to your computer and use it in GitHub Desktop.

Select an option

Save about36km/2b13924baf3d5d75e90d2e8aca8aa035 to your computer and use it in GitHub Desktop.
pandas with huge data.
def output_by_query(self, query, filename):
with self.connection as conn:
for chunk1 in pandas.read_sql(query, conn, chunksize=10000):
chunk1.to_csv(filename, header=False, index=None,mode='a')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment