title: Code for date_range didnot work as expected
body: <p>I didnot get the expected result for date_range function.
  I got the error "'NoneType' object has no attribute 'set_index'"</p>
  
  <p>please help.</p>
  
  <p>I created a Dataframe, 
  called the date_range function and put it into a variable
  used the variable from previous function to set the column as index to the dataframe. </p>
  
  <pre><code>import pandas as pd
  df=pd.DataFrame({
      'Open':[12,15,20,23,25,30,23,22,21,21,22,20,12,13],
      'Close':[8,9,9,12,12,23,12,12,12,8,4,2,8,5]
      })
  
  rng=pd.date_range(start='1/1/2018', end='1/14/2018',freq='D')
  rng
  
  df.set_index(rng,inplace=True)
  df
  </code></pre>
  
  <p>Expected results: The date column should be created as an index.</p>
  
  <p>Actual Result : Error with message "'NoneType' object has no attribute 'set_index'" </p>