title: is there a way to fit month wise date column into multivariate linear regression model with categorical data?
body: <p>I tried Multivariate linear regression with categorical variables.
  Used One hot encoder technique to solve the problem but got this error.</p>
  
  <p>I have tried converting date string to timestamp using pd.to_datetime() function but then also it gave error like --
  TypeError: int() argument must be a string, a bytes-like object or a number, not 'Timestamp'</p>
  
  <p>So I removed this thing and got backto solve the actual specified error using some alternative way..</p>
  
  <pre class="lang-py prettyprint-override"><code>
  from sklearn.preprocessing import LabelEncoder
  le = LabelEncoder() 
  dfle = df    #df is the dataset containing column names ----- 'Section', 'BRAND', 'RSP', 'Monthstartdate', and 'Sales'*(to be predicted)* --------- 
  
  dfle.Section = le.fit_transform(dfle.Section)  #Categorical values  (2 in number )
  dfle.BRAND = le.fit_transform(dfle.BRAND)    #Categorical values (390 in number)
  
  X = dfle[['Section', 'BRAND', 'RSP', 'Monthstartdate']].values
  
  y = dfle.Sales
  
  
  
  from sklearn.preprocessing import OneHotEncoder
  ohe =  OneHotEncoder(categorical_features = [0])
  
  X = ohe.fit_transform(X).toarray()
  
  </code></pre>
  
  <p>Expected result was that the array could have been fit properly but getting this error.</p>
  
  <p>Error -</p>
  
  <p>---->  X = ohe.fit_transform(X).toarray()</p>
  
  <p>ValueError: could not convert string to float: '01/06/2016'</p>
  
  <p>('01/06/2016' is string in this case, not timestamp, It would have been awesome if it could have been timestamp and working with the regression problem)</p>