title: Appending Column With value_counts() in pandas
body: <p>I have a dataframe named <strong>output</strong> that looks like as below :</p>
  
  <pre><code>   created_at
  0  1/8/2017 0:00
  1  1/8/2017 0:00
  2  1/8/2017 0:00
  3  1/8/2017 0:00
  4  1/8/2017 0:00
  5  1/8/2017 1:00
  6  1/8/2017 2:00
  7  1/8/2017 3:00
  </code></pre>
  
  <p>I wanted to count the number of times a particular time appears in the dataframe named <strong>df3</strong>. The result is as as below :</p>
  
  <pre><code>1/8/2017 0:00    5
  1/8/2017 1:00    1
  1/8/2017 3:00    1
  1/8/2017 2:00    1
  </code></pre>
  
  <p>What I want is to have two headings added to the df3 called <strong>created_at</strong> and <strong>count</strong>.</p>
  
  <p>What I first did was to remove the duplicates from the <strong>output dataframe</strong> and sorted the values, getting a result as below : </p>
  
  <pre><code>   created_at
  0  1/8/2017 0:00
  5  1/8/2017 1:00
  6  1/8/2017 2:00
  7  1/8/2017 3:00
  </code></pre>
  
  <p>Now I added the column <strong>count</strong> in the <strong>output dataframe</strong> but I get the result as below :</p>
  
  <pre><code>   created_at        count
  0  1/8/2017 0:00     NaN
  5  1/8/2017 1:00     NaN
  6  1/8/2017 2:00     NaN
  7  1/8/2017 3:00     NaN
  </code></pre>
  
  <p>What i want to achieve is a dataframe called <strong>result</strong> which should look like this :</p>
  
  <pre><code>   created_at        count
  0  1/8/2017 0:00     5
  5  1/8/2017 1:00     1
  6  1/8/2017 2:00     1
  7  1/8/2017 3:00     1
  </code></pre>
  
  <p>How do I do this? My code is as below :</p>
  
  <pre><code>import pandas as pd
  
  df1 = pd.read_csv(path1)
  df2 = pd.read_csv(path2)
  output = pd.merge(df1, df2, how="inner", on="created_at")
  df3 = output.created_at.value_counts()
  
  output = output.drop_duplicates()
  output = output.sort_values(by=['created_at'])
  output['count'] = df3
  
  
  print(output,'\n\n')
  </code></pre>
  
  <p>Any and all help would be appreciated</p>
  
  <p>Thanks</p>