title: Export pandas data frame to Azure Data Lake Storage as a CSV file?
body: <p>This may be an uncommon question as I believe it has never been asked before, but is it possible to export a Pandas data frame straight to an Azure Data Lake Storage as a CSV file?</p>
  <p>To add some context, I have a pandas dataframe which gets exported as a CSV file to a local directory, using the <code>datalakeserviceclient</code> I then get the CSV file from the file path and write the file into the data lake storage.</p>
  <pre><code>
  docs[:0].to_csv(&quot;test.csv&quot;, index = False)
  docs.to_csv(&quot;test.csv&quot;, index = False, header = False ,mode = 'a', quoting = csv.QUOTE_NONNUMERIC)
  
  try:  
      global service_client
          
      service_client = DataLakeServiceClient(account_url=&quot;{}://{}.dfs.core.windows.net&quot;.format(
          &quot;https&quot;, &quot;XXXX&quot;), credential='XXX')
      
  
      file_system_client = service_client.get_file_system_client(file_system=&quot;root&quot;)
  
      directory_client = file_system_client.get_directory_client(&quot;test_db&quot;) 
  
      file_client = directory_client.create_file(&quot;test.csv&quot;) 
      local_file = open(r&quot;C:XXXX\test.csv&quot;,'rb') 
  
      file_contents = local_file.read()
  
      file_client.upload_data(file_contents, overwrite=True) 
  
  
  except Exception as e:
      print(e) 
  
  
  </code></pre>
  <p>However, I don't want the data frame to be exported to my local directory, instead I want to find a way to export it straight to the data lake storage. Is this actually possible?</p>
  <p>Any help is appreciated</p>