title: Limiting maximum size of dataframe partition
body: <p>When I write out a dataframe to, say, csv, a .csv file is created for each partition.  Suppose I want to limit the max size of each file to, say, 1 MB.  I could do the write multiple times and increase the argument to repartition each time.  Is there a way I can calculate ahead of time what argument to use for repartition to ensure the max size of each file is less than some specified size.</p>
  
  <p>I imagine there might be pathological cases where all the data ends up on one partition. So make the weaker assumption that we only want to ensure that the average file size is less than some specified amount, say 1 MB. </p>