Advertisement
furas

Python - pandas read csv with iterator

Mar 19th, 2017
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. import pandas as pd
  2.  
  3. df = pd.read_csv('data.csv', iterator=True)
  4.  
  5. size = 8000
  6.  
  7. while True:
  8.     try:
  9.         data = df.get_chunk(size)
  10.         print('>', data)
  11.     except StopIteration:    
  12.         break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement