title: Create empty csv file with pandas
body: <p>I am interacting through a number of csv files and want to append the mean temperatures to a blank csv file. How do you create an empty csv file with pandas?</p>
  
  <pre><code>for EachMonth in MonthsInAnalysis:
      TheCurrentMonth = pd.read_csv('MonthlyDataSplit/Day/Day%s.csv' % EachMonth)
      MeanDailyTemperaturesForCurrentMonth = TheCurrentMonth.groupby('Day')['AirTemperature'].mean().reset_index(name='MeanDailyAirTemperature')
      with open('my_csv.csv', 'a') as f:
          df.to_csv(f, header=False)
  </code></pre>
  
  <p>So in the above code how do I create the <code>my_csv.csv</code> prior to the <code>for</code> loop?</p>
  
  <p>Just a note I know you can create a data frame then save the data frame to csv but I am interested in whether you can skip this step.</p>
  
  <p>In terms of context I have the following csv files:</p>
  
  <p><a href="https://i.stack.imgur.com/2aU1f.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2aU1f.png" alt="enter image description here"></a></p>
  
  <p>Each of which have the following structure:</p>
  
  <p><a href="https://i.stack.imgur.com/tHsy2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tHsy2.png" alt="enter image description here"></a></p>
  
  <p>The Day column reads up to 30 days for each file. </p>
  
  <p>I would like to output a csv file that looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/C7Fff.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/C7Fff.png" alt="enter image description here"></a></p>
  
  <p>But obviously includes all the days for all the months. </p>
  
  <p>My issue is that I don't know which months are included in each analysis hence I wanted to use a for loop that used a list that has that information in it to access the relevant csvs, calculate the mean temperature then save it all into one csv.</p>
  
  <p>Input as text: </p>
  
  <pre><code>    Unnamed: 0  AirTemperature  AirHumidity SoilTemperature SoilMoisture    LightIntensity  WindSpeed   Year    Month   Day Hour    Minute  Second  TimeStamp   MonthCategorical    TimeOfDay
  6   6   18  84  17  41  40  4   2016    1   1   6   1   1   10106   January Day
  7   7   20  88  22  92  31  0   2016    1   1   7   1   1   10107   January Day
  8   8   23  1   22  59  3   0   2016    1   1   8   1   1   10108   January Day
  9   9   23  3   22  72  41  4   2016    1   1   9   1   1   10109   January Day
  10  10  24  63  23  83  85  0   2016    1   1   10  1   1   10110   January Day
  11  11  29  73  27  50  1   4   2016    1   1   11  1   1   10111   January Day
  </code></pre>