<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="df1 = pd.DataFrame([[1, 1]], columns=['x','x'])
df2 = pd.DataFrame([[1, 1]], columns=['x','y'])
pd.merge(df1, df2, on='x')"><pre class="notranslate"><code class="notranslate">df1 = pd.DataFrame([[1, 1]], columns=['x','x'])
df2 = pd.DataFrame([[1, 1]], columns=['x','y'])
pd.merge(df1, df2, on='x')
</code></pre></div>
<p dir="auto">Results in:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;test.py&quot;, line 5, in &lt;module&gt;
    m = pd.merge(df1, df2, on='x')
  File &quot;/usr/lib/python3/dist-packages/pandas/tools/merge.py&quot;, line 35, in merge
    return op.get_result()
  File &quot;/usr/lib/python3/dist-packages/pandas/tools/merge.py&quot;, line 196, in get_result
    join_index, left_indexer, right_indexer = self._get_join_info()
  File &quot;/usr/lib/python3/dist-packages/pandas/tools/merge.py&quot;, line 324, in _get_join_info
    sort=self.sort, how=self.how)
  File &quot;/usr/lib/python3/dist-packages/pandas/tools/merge.py&quot;, line 516, in _get_join_indexers
    llab, rlab, shape = map(list, zip( * map(fkeys, left_keys, right_keys)))
  File &quot;/usr/lib/python3/dist-packages/pandas/tools/merge.py&quot;, line 681, in _factorize_keys
    llab = rizer.factorize(lk)
  File &quot;pandas/hashtable.pyx&quot;, line 850, in pandas.hashtable.Int64Factorizer.factorize (pandas/hashtable.c:15601)
ValueError: Buffer has wrong number of dimensions (expected 1, got 2)"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
  File "test.py", line 5, in &lt;module&gt;
    m = pd.merge(df1, df2, on='x')
  File "/usr/lib/python3/dist-packages/pandas/tools/merge.py", line 35, in merge
    return op.get_result()
  File "/usr/lib/python3/dist-packages/pandas/tools/merge.py", line 196, in get_result
    join_index, left_indexer, right_indexer = self._get_join_info()
  File "/usr/lib/python3/dist-packages/pandas/tools/merge.py", line 324, in _get_join_info
    sort=self.sort, how=self.how)
  File "/usr/lib/python3/dist-packages/pandas/tools/merge.py", line 516, in _get_join_indexers
    llab, rlab, shape = map(list, zip( * map(fkeys, left_keys, right_keys)))
  File "/usr/lib/python3/dist-packages/pandas/tools/merge.py", line 681, in _factorize_keys
    llab = rizer.factorize(lk)
  File "pandas/hashtable.pyx", line 850, in pandas.hashtable.Int64Factorizer.factorize (pandas/hashtable.c:15601)
ValueError: Buffer has wrong number of dimensions (expected 1, got 2)
</code></pre></div>
<p dir="auto">See <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="120236046" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/11754" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/11754/hovercard" href="https://github.com/pandas-dev/pandas/issues/11754">#11754</a></p>
<p dir="auto"><a href="https://stackoverflow.com/questions/50979873/linear-fit-to-pandas-datetime64-values" rel="nofollow">Fitting a linear model to Timestamps currently does not work out of the box.</a><br>
and pandas does not support the ols function any further. When using e.g. seaborn to make a fit it throws an error.</p>
<blockquote>
<p dir="auto">TypeError: reduction operation 'mean' not allowed for this dtype</p>
</blockquote>
<p dir="auto">I wonder whether the dtype can be change so that mean is supported? And whether this would make it compatible with other packages, such as scikit-learn, seaborn, etc. Also, the mean of some dates could be useful for other use cases. It does make sense to calculate the mean of some dates doesn't it?</p>