title: Is there a way with Python + Pandas to save small chunk files individually?
body: <p>I am very new to programming and I'm currently trying to breakdown a CSV file into bite-sized chunks and saving those chunks as individual files. I was able to do it using a super roundabout way but now I want to figure out how to write a function that does this for me.
  This is the code I have now:</p>
  <pre><code>import pandas as pd
  
  def chunky(file, chunksize, iterator, rounds):
    df = pd.read_csv(file, chunksize = chunksize, iterator = iterator)
    count = 0
    while count &lt; rounds:
      count += 1
      file = next(df)
      file.to_csv(&quot;output.csv&quot;)
  </code></pre>
  <p>However, when I do this it will print the output as one file but I am looking to save multiple individual files. Any and all help is appreciated! Thank you so much in advance :)</p>