title: How to write and save csv files in a loop on google colab?
body: <p>I'm trying to create and save multiple csv files (in a loop, 1 file per iteration) on a google colab notebook. I'm using</p>
  <pre><code>drive.mount('/drive')
  f3.to_csv('/drive/My Drive/Colab Notebooks/data/file.csv', index =False)
  </code></pre>
  <p>But obviously it's not working. the cell is giving me a text box to enter my authorization code.
  Is there a way around this to save files in a loop?</p>
  <p>To make it clear, here's the code</p>
  <pre><code>for k in portkey:
   f3 = f2[f2.port_key_anonymised == k]
   if f3.shape[0]&gt;0 :
    drive.mount('/drive')
    f3.to_csv('/drive/My Drive/Colab Notebooks/data/'+str(nb)+'.csv', index =False)
  </code></pre>
  <p>Thank you!</p>