<p dir="auto">This doesn't work:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="a = pd.DataFrame(data=np.random.rand(3))
time = pd.date_range('2000-01-01', tz='UTC', periods=3, freq='10ms', name='time')
a['time'] = time
b = pd.DataFrame(data=np.random.rand(3))
c = pd.concat([a, b])"><pre class="notranslate"><span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>(<span class="pl-s1">data</span><span class="pl-c1">=</span><span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">rand</span>(<span class="pl-c1">3</span>))
<span class="pl-s1">time</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-en">date_range</span>(<span class="pl-s">'2000-01-01'</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'UTC'</span>, <span class="pl-s1">periods</span><span class="pl-c1">=</span><span class="pl-c1">3</span>, <span class="pl-s1">freq</span><span class="pl-c1">=</span><span class="pl-s">'10ms'</span>, <span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s">'time'</span>)
<span class="pl-s1">a</span>[<span class="pl-s">'time'</span>] <span class="pl-c1">=</span> <span class="pl-s1">time</span>
<span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>(<span class="pl-s1">data</span><span class="pl-c1">=</span><span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">rand</span>(<span class="pl-c1">3</span>))
<span class="pl-s1">c</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-en">concat</span>([<span class="pl-s1">a</span>, <span class="pl-s1">b</span>])</pre></div>
<p dir="auto">It produces a type error:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/usr/lib/python3.6/site-packages/pandas/core/indexes/api.py:87: RuntimeWarning: '&lt;' not supported between instances of 'str' and 'int', sort order is undefined for incomparable objects
  result = result.union(other)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
&lt;ipython-input-22-f0e01a86e895&gt; in &lt;module&gt;()
----&gt; 1 c = pd.concat([a, b])

/usr/lib/python3.6/site-packages/pandas/core/reshape/concat.py in concat(objs, axis, join, join_axes, ignore_index, keys, levels, names, verify_integrity, copy)
    211                        verify_integrity=verify_integrity,
    212                        copy=copy)
--&gt; 213     return op.get_result()
    214 
    215 

/usr/lib/python3.6/site-packages/pandas/core/reshape/concat.py in get_result(self)
    406             new_data = concatenate_block_managers(
    407                 mgrs_indexers, self.new_axes, concat_axis=self.axis,
--&gt; 408                 copy=self.copy)
    409             if not self.copy:
    410                 new_data._consolidate_inplace()

/usr/lib/python3.6/site-packages/pandas/core/internals.py in concatenate_block_managers(mgrs_indexers, axes, concat_axis, copy)
   5196         else:
   5197             b = make_block(
-&gt; 5198                 concatenate_join_units(join_units, concat_axis, copy=copy),
   5199                 placement=placement)
   5200         blocks.append(b)

/usr/lib/python3.6/site-packages/pandas/core/internals.py in concatenate_join_units(join_units, concat_axis, copy)
   5325     to_concat = [ju.get_reindexed_values(empty_dtype=empty_dtype,
   5326                                          upcasted_na=upcasted_na)
-&gt; 5327                  for ju in join_units]
   5328 
   5329     if len(to_concat) == 1:

/usr/lib/python3.6/site-packages/pandas/core/internals.py in &lt;listcomp&gt;(.0)
   5325     to_concat = [ju.get_reindexed_values(empty_dtype=empty_dtype,
   5326                                          upcasted_na=upcasted_na)
-&gt; 5327                  for ju in join_units]
   5328 
   5329     if len(to_concat) == 1:

/usr/lib/python3.6/site-packages/pandas/core/internals.py in get_reindexed_values(self, empty_dtype, upcasted_na)
   5596                     pass
   5597                 else:
-&gt; 5598                     missing_arr = np.empty(self.shape, dtype=empty_dtype)
   5599                     missing_arr.fill(fill_value)
   5600                     return missing_arr

TypeError: data type not understood
&gt; /usr/lib/python3.6/site-packages/pandas/core/internals.py(5598)get_reindexed_values()
   5596                     pass
   5597                 else:
-&gt; 5598                     missing_arr = np.empty(self.shape, dtype=empty_dtype)
   5599                     missing_arr.fill(fill_value)
   5600                     return missing_arr"><pre class="notranslate"><span class="pl-c1">/</span><span class="pl-s1">usr</span><span class="pl-c1">/</span><span class="pl-s1">lib</span><span class="pl-c1">/</span><span class="pl-s1">python3</span>.<span class="pl-c1">6</span><span class="pl-c1">/</span><span class="pl-s1">site</span><span class="pl-c1">-</span><span class="pl-s1">packages</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">indexes</span><span class="pl-c1">/</span><span class="pl-s1">api</span>.<span class="pl-s1">py</span>:<span class="pl-c1">87</span>: <span class="pl-v">RuntimeWarning</span>: <span class="pl-s">'&lt;'</span> <span class="pl-c1">not</span> <span class="pl-s1">supported</span> <span class="pl-s1">between</span> <span class="pl-s1">instances</span> <span class="pl-s1">of</span> <span class="pl-s">'str'</span> <span class="pl-c1">and</span> <span class="pl-s">'int'</span>, <span class="pl-s1">sort</span> <span class="pl-s1">order</span> <span class="pl-c1">is</span> <span class="pl-s1">undefined</span> <span class="pl-k">for</span> <span class="pl-s1">incomparable</span> <span class="pl-s1">objects</span>
  <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-s1">result</span>.<span class="pl-en">union</span>(<span class="pl-s1">other</span>)
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span>
<span class="pl-v">TypeError</span>                                 <span class="pl-v">Traceback</span> (<span class="pl-s1">most</span> <span class="pl-s1">recent</span> <span class="pl-s1">call</span> <span class="pl-s1">last</span>)
<span class="pl-c1">&lt;</span><span class="pl-s1">ipython</span><span class="pl-c1">-</span><span class="pl-s1">input</span><span class="pl-c1">-</span><span class="pl-c1">22</span><span class="pl-c1">-</span><span class="pl-en">f0e01a86e895</span><span class="pl-c1">&gt;</span> <span class="pl-c1">in</span> <span class="pl-c1">&lt;</span><span class="pl-s1">module</span><span class="pl-c1">&gt;</span>()
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">1</span> <span class="pl-s1">c</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-en">concat</span>([<span class="pl-s1">a</span>, <span class="pl-s1">b</span>])

<span class="pl-c1">/</span><span class="pl-s1">usr</span><span class="pl-c1">/</span><span class="pl-s1">lib</span><span class="pl-c1">/</span><span class="pl-s1">python3</span>.<span class="pl-c1">6</span><span class="pl-c1">/</span><span class="pl-s1">site</span><span class="pl-c1">-</span><span class="pl-s1">packages</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">reshape</span><span class="pl-c1">/</span><span class="pl-s1">concat</span>.<span class="pl-en">py</span> <span class="pl-c1">in</span> <span class="pl-s1">concat</span>(<span class="pl-s1">objs</span>, <span class="pl-s1">axis</span>, <span class="pl-s1">join</span>, <span class="pl-s1">join_axes</span>, <span class="pl-s1">ignore_index</span>, <span class="pl-s1">keys</span>, <span class="pl-s1">levels</span>, <span class="pl-s1">names</span>, <span class="pl-s1">verify_integrity</span>, <span class="pl-s1">copy</span>)
    <span class="pl-c1">211</span>                        <span class="pl-s1">verify_integrity</span><span class="pl-c1">=</span><span class="pl-s1">verify_integrity</span>,
    <span class="pl-c1">212</span>                        <span class="pl-s1">copy</span><span class="pl-c1">=</span><span class="pl-s1">copy</span>)
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">213</span>     <span class="pl-s1">return</span> <span class="pl-s1">op</span>.<span class="pl-en">get_result</span>()
    <span class="pl-c1">214</span> 
    <span class="pl-c1">215</span> 

<span class="pl-c1">/</span><span class="pl-s1">usr</span><span class="pl-c1">/</span><span class="pl-s1">lib</span><span class="pl-c1">/</span><span class="pl-s1">python3</span>.<span class="pl-c1">6</span><span class="pl-c1">/</span><span class="pl-s1">site</span><span class="pl-c1">-</span><span class="pl-s1">packages</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">reshape</span><span class="pl-c1">/</span><span class="pl-s1">concat</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">get_result</span>(<span class="pl-s1">self</span>)
    <span class="pl-c1">406</span>             <span class="pl-s1">new_data</span> <span class="pl-c1">=</span> <span class="pl-en">concatenate_block_managers</span>(
    <span class="pl-c1">407</span>                 <span class="pl-s1">mgrs_indexers</span>, <span class="pl-s1">self</span>.<span class="pl-s1">new_axes</span>, <span class="pl-s1">concat_axis</span><span class="pl-c1">=</span><span class="pl-s1">self</span>.<span class="pl-s1">axis</span>,
<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">408</span>                 <span class="pl-s1">copy</span><span class="pl-c1">=</span><span class="pl-s1">self</span>.<span class="pl-s1">copy</span>)
    <span class="pl-c1">409</span>             <span class="pl-k">if</span> <span class="pl-c1">not</span> <span class="pl-s1">self</span>.<span class="pl-s1">copy</span>:
    <span class="pl-c1">410</span>                 <span class="pl-s1">new_data</span>.<span class="pl-en">_consolidate_inplace</span>()

<span class="pl-c1">/</span><span class="pl-s1">usr</span><span class="pl-c1">/</span><span class="pl-s1">lib</span><span class="pl-c1">/</span><span class="pl-s1">python3</span>.<span class="pl-c1">6</span><span class="pl-c1">/</span><span class="pl-s1">site</span><span class="pl-c1">-</span><span class="pl-s1">packages</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">internals</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">concatenate_block_managers</span>(<span class="pl-s1">mgrs_indexers</span>, <span class="pl-s1">axes</span>, <span class="pl-s1">concat_axis</span>, <span class="pl-s1">copy</span>)
   <span class="pl-c1">5196</span>         <span class="pl-s1">else</span>:
   <span class="pl-c1">5197</span>             <span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-en">make_block</span>(
<span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">5198</span>                 <span class="pl-en">concatenate_join_units</span>(<span class="pl-s1">join_units</span>, <span class="pl-s1">concat_axis</span>, <span class="pl-s1">copy</span><span class="pl-c1">=</span><span class="pl-s1">copy</span>),
   <span class="pl-c1">5199</span>                 <span class="pl-s1">placement</span><span class="pl-c1">=</span><span class="pl-s1">placement</span>)
   <span class="pl-c1">5200</span>         <span class="pl-s1">blocks</span>.<span class="pl-en">append</span>(<span class="pl-s1">b</span>)

<span class="pl-c1">/</span><span class="pl-s1">usr</span><span class="pl-c1">/</span><span class="pl-s1">lib</span><span class="pl-c1">/</span><span class="pl-s1">python3</span>.<span class="pl-c1">6</span><span class="pl-c1">/</span><span class="pl-s1">site</span><span class="pl-c1">-</span><span class="pl-s1">packages</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">internals</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">concatenate_join_units</span>(<span class="pl-s1">join_units</span>, <span class="pl-s1">concat_axis</span>, <span class="pl-s1">copy</span>)
   <span class="pl-c1">5325</span>     <span class="pl-s1">to_concat</span> <span class="pl-c1">=</span> [<span class="pl-s1">ju</span>.<span class="pl-en">get_reindexed_values</span>(<span class="pl-s1">empty_dtype</span><span class="pl-c1">=</span><span class="pl-s1">empty_dtype</span>,
   <span class="pl-c1">5326</span>                                          <span class="pl-s1">upcasted_na</span><span class="pl-c1">=</span><span class="pl-s1">upcasted_na</span>)
<span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">5327</span>                  <span class="pl-s1">for</span> <span class="pl-s1">ju</span> <span class="pl-c1">in</span> <span class="pl-s1">join_units</span>]
   <span class="pl-c1">5328</span> 
   <span class="pl-c1">5329</span>     <span class="pl-k">if</span> <span class="pl-en">len</span>(<span class="pl-s1">to_concat</span>) <span class="pl-c1">==</span> <span class="pl-c1">1</span>:

<span class="pl-c1">/</span><span class="pl-s1">usr</span><span class="pl-c1">/</span><span class="pl-s1">lib</span><span class="pl-c1">/</span><span class="pl-s1">python3</span>.<span class="pl-c1">6</span><span class="pl-c1">/</span><span class="pl-s1">site</span><span class="pl-c1">-</span><span class="pl-s1">packages</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">internals</span>.<span class="pl-en">py</span> <span class="pl-c1">in</span> <span class="pl-c1">&lt;</span><span class="pl-s1">listcomp</span><span class="pl-c1">&gt;</span>(<span class="pl-c1">.0</span>)
   <span class="pl-c1">5325</span>     <span class="pl-s1">to_concat</span> <span class="pl-c1">=</span> [<span class="pl-s1">ju</span>.<span class="pl-en">get_reindexed_values</span>(<span class="pl-s1">empty_dtype</span><span class="pl-c1">=</span><span class="pl-s1">empty_dtype</span>,
   <span class="pl-c1">5326</span>                                          <span class="pl-s1">upcasted_na</span><span class="pl-c1">=</span><span class="pl-s1">upcasted_na</span>)
<span class="pl-c1">-</span><span class="pl-c1">&gt;</span> <span class="pl-c1">5327</span>                  <span class="pl-s1">for</span> <span class="pl-s1">ju</span> <span class="pl-c1">in</span> <span class="pl-s1">join_units</span>]
   <span class="pl-c1">5328</span> 
   <span class="pl-c1">5329</span>     <span class="pl-k">if</span> <span class="pl-en">len</span>(<span class="pl-s1">to_concat</span>) <span class="pl-c1">==</span> <span class="pl-c1">1</span>:

<span class="pl-c1">/</span><span class="pl-s1">usr</span><span class="pl-c1">/</span><span class="pl-s1">lib</span><span class="pl-c1">/</span><span class="pl-s1">python3</span>.<span class="pl-c1">6</span><span class="pl-c1">/</span><span class="pl-s1">site</span><span class="pl-c1">-</span><span class="pl-s1">packages</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">internals</span>.<span class="pl-s1">py</span> <span class="pl-c1">in</span> <span class="pl-en">get_reindexed_values</span>(<span class="pl-s1">self</span>, <span class="pl-s1">empty_dtype</span>, <span class="pl-s1">upcasted_na</span>)
   <span class="pl-c1">5596</span>                     <span class="pl-s1">pass</span>
   <span class="pl-c1">5597</span>                 <span class="pl-s1">else</span>:
<span class="pl-c1">-&gt;</span> <span class="pl-c1">5598</span>                     <span class="pl-s1">missing_arr</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">empty</span>(<span class="pl-s1">self</span>.<span class="pl-s1">shape</span>, <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">empty_dtype</span>)
   <span class="pl-c1">5599</span>                     <span class="pl-s1">missing_arr</span>.<span class="pl-en">fill</span>(<span class="pl-s1">fill_value</span>)
   <span class="pl-c1">5600</span>                     <span class="pl-k">return</span> <span class="pl-s1">missing_arr</span>

<span class="pl-v">TypeError</span>: <span class="pl-s1">data</span> <span class="pl-s1">type</span> <span class="pl-c1">not</span> <span class="pl-s1">understood</span>
<span class="pl-c1">&gt;</span> <span class="pl-c1">/</span><span class="pl-s1">usr</span><span class="pl-c1">/</span><span class="pl-s1">lib</span><span class="pl-c1">/</span><span class="pl-s1">python3</span>.<span class="pl-c1">6</span><span class="pl-c1">/</span><span class="pl-s1">site</span><span class="pl-c1">-</span><span class="pl-s1">packages</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">internals</span>.<span class="pl-en">py</span>(<span class="pl-c1">5598</span>)<span class="pl-en">get_reindexed_values</span>()
   <span class="pl-c1">5596</span>                     <span class="pl-k">pass</span>
   <span class="pl-c1">5597</span>                 <span class="pl-s1">else</span>:
<span class="pl-c1">-&gt;</span> <span class="pl-c1">5598</span>                     <span class="pl-s1">missing_arr</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">empty</span>(<span class="pl-s1">self</span>.<span class="pl-s1">shape</span>, <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">empty_dtype</span>)
   <span class="pl-c1">5599</span>                     <span class="pl-s1">missing_arr</span>.<span class="pl-en">fill</span>(<span class="pl-s1">fill_value</span>)
   <span class="pl-c1">5600</span>                     <span class="pl-k">return</span> <span class="pl-s1">missing_arr</span></pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">When concatenating dataframes, of which one contains a column with <code class="notranslate">datetime64[ns, UTC]</code>, the process fails. This currently breaks my workflow, and I'd like to stick with timezone aware times...</p>
<p dir="auto">It works with plain <code class="notranslate">datetime64[ns]</code>.:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="a['time'] = pd.date_range('2000-01-01', tz=None, periods=3, freq='10ms', name='time'
pd.concat([a, b])"><pre class="notranslate"><span class="pl-s1">a</span>[<span class="pl-s">'time'</span>] <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-s1">date_range</span>(<span class="pl-s">'2000-01-01'</span>, <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">periods</span><span class="pl-c1">=</span><span class="pl-c1">3</span>, <span class="pl-s1">freq</span><span class="pl-c1">=</span><span class="pl-s">'10ms'</span>, <span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s">'time'</span>
<span class="pl-s1">pd</span>.<span class="pl-en">concat</span>([<span class="pl-s1">a</span>, <span class="pl-s1">b</span>])</pre></div>
<p dir="auto">and produces the expected output:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/usr/lib/python3.6/site-packages/pandas/core/indexes/api.py:87: RuntimeWarning: '&lt;' not supported between instances of 'str' and 'int', sort order is undefined for incomparable objects
  result = result.union(other)
Out[35]: 
          0                    time
0  0.071325 2000-01-01 00:00:00.000
1  0.485844 2000-01-01 00:00:00.010
2  0.247131 2000-01-01 00:00:00.020
0  0.595540                     NaT
1  0.609389                     NaT
2  0.850834                     NaT"><pre class="notranslate"><span class="pl-c1">/</span><span class="pl-s1">usr</span><span class="pl-c1">/</span><span class="pl-s1">lib</span><span class="pl-c1">/</span><span class="pl-s1">python3</span>.<span class="pl-c1">6</span><span class="pl-c1">/</span><span class="pl-s1">site</span><span class="pl-c1">-</span><span class="pl-s1">packages</span><span class="pl-c1">/</span><span class="pl-s1">pandas</span><span class="pl-c1">/</span><span class="pl-s1">core</span><span class="pl-c1">/</span><span class="pl-s1">indexes</span><span class="pl-c1">/</span><span class="pl-s1">api</span>.<span class="pl-s1">py</span>:<span class="pl-c1">87</span>: <span class="pl-v">RuntimeWarning</span>: <span class="pl-s">'&lt;'</span> <span class="pl-c1">not</span> <span class="pl-s1">supported</span> <span class="pl-s1">between</span> <span class="pl-s1">instances</span> <span class="pl-s1">of</span> <span class="pl-s">'str'</span> <span class="pl-c1">and</span> <span class="pl-s">'int'</span>, <span class="pl-s1">sort</span> <span class="pl-s1">order</span> <span class="pl-c1">is</span> <span class="pl-s1">undefined</span> <span class="pl-k">for</span> <span class="pl-s1">incomparable</span> <span class="pl-s1">objects</span>
  <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-s1">result</span>.<span class="pl-en">union</span>(<span class="pl-s1">other</span>)
<span class="pl-v">Out</span>[<span class="pl-c1">35</span>]: 
          <span class="pl-c1">0</span>                    <span class="pl-s1">time</span>
<span class="pl-c1">0</span>  <span class="pl-c1">0.071325</span> <span class="pl-c1">2000</span><span class="pl-c1">-</span><span class="pl-c1">01</span><span class="pl-c1">-</span><span class="pl-c1">01</span> <span class="pl-c1">00</span>:<span class="pl-c1">00</span>:<span class="pl-c1">00.000</span>
<span class="pl-c1">1</span>  <span class="pl-c1">0.485844</span> <span class="pl-c1">2000</span><span class="pl-c1">-</span><span class="pl-c1">01</span><span class="pl-c1">-</span><span class="pl-c1">01</span> <span class="pl-c1">00</span>:<span class="pl-c1">00</span>:<span class="pl-c1">00.010</span>
<span class="pl-c1">2</span>  <span class="pl-c1">0.247131</span> <span class="pl-c1">2000</span><span class="pl-c1">-</span><span class="pl-c1">01</span><span class="pl-c1">-</span><span class="pl-c1">01</span> <span class="pl-c1">00</span>:<span class="pl-c1">00</span>:<span class="pl-c1">00.020</span>
<span class="pl-c1">0</span>  <span class="pl-c1">0.595540</span>                     <span class="pl-v">NaT</span>
<span class="pl-c1">1</span>  <span class="pl-c1">0.609389</span>                     <span class="pl-v">NaT</span>
<span class="pl-c1">2</span>  <span class="pl-c1">0.850834</span>                     <span class="pl-v">NaT</span></pre></div>
<h4 dir="auto">Expected Output</h4>
<p dir="auto">Similar to the result with plain numpy <code class="notranslate">datetime64</code>, <code class="notranslate">pd.concat()</code> should simply fill in the missing time values with <code class="notranslate">NaT</code>.</p>
<p dir="auto">Thanks and regards</p>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details> 
INSTALLED VERSIONS
------------------
commit: None
python: 3.6.3.final.0
python-bits: 64
OS: Linux
OS-release: 4.13.12-1-ARCH
machine: x86_64
processor: 
byteorder: little
LC_ALL: None
LANG: de_DE.utf8
LOCALE: de_DE.UTF-8
<p dir="auto">pandas: 0.21.0<br>
pytest: 3.3.0<br>
pip: 9.0.1<br>
setuptools: 38.2.3<br>
Cython: 0.27.3<br>
numpy: 1.13.3<br>
scipy: 1.0.0<br>
pyarrow: None<br>
xarray: 0.10.0<br>
IPython: 6.2.1<br>
sphinx: 1.6.5<br>
patsy: None<br>
dateutil: 2.6.1<br>
pytz: 2017.3<br>
blosc: None<br>
bottleneck: 1.2.1<br>
tables: 3.4.2<br>
numexpr: 2.6.4<br>
feather: None<br>
matplotlib: 2.1.0<br>
openpyxl: None<br>
xlrd: None<br>
xlwt: None<br>
xlsxwriter: None<br>
lxml: None<br>
bs4: None<br>
html5lib: 0.999999999<br>
sqlalchemy: 1.1.15<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: 2.10<br>
s3fs: 0.0.9<br>
fastparquet: None<br>
pandas_gbq: None<br>
pandas_datareader: 0.5.0</p>
</details>
<p dir="auto">Concatenating DFs that have columns with all NaTs and TZ-aware ones breaks as of 0.17.1:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [1]: import pandas as pd
In [2]: df1 = pd.DataFrame([[pd.NaT], [pd.NaT]])
In [3]: df1
Out[2]:
    0
0   NaT
1   NaT
In [4]: df2 = pd.DataFrame([[pd.Timestamp('2015/01/01', tz='UTC')], [pd.Timestamp('2016/01/01', tz='UTC')]])
In [5]: df2
Out[4]:
    0
0   2015-01-01 00:00:00+00:00
1   2016-01-01 00:00:00+00:00
In [6]: pd.concat([df1, df2])

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
&lt;ipython-input-6-f61a1ab4009e&gt; in &lt;module&gt;()
----&gt; 1 pd.concat([df1, df2])

/.../env/local/lib/python2.7/site-packages/pandas/tools/merge.py in concat(objs, axis, join, join_axes, ignore_index, keys, levels, names, verify_integrity, copy)
    811                        verify_integrity=verify_integrity,
    812                        copy=copy)
--&gt; 813     return op.get_result()
    814 
    815 

/.../env/local/lib/python2.7/site-packages/pandas/tools/merge.py in get_result(self)
    993 
    994             new_data = concatenate_block_managers(
--&gt; 995                 mgrs_indexers, self.new_axes, concat_axis=self.axis, copy=self.copy)
    996             if not self.copy:
    997                 new_data._consolidate_inplace()

/.../env/local/lib/python2.7/site-packages/pandas/core/internals.py in concatenate_block_managers(mgrs_indexers, axes, concat_axis, copy)
   4454                                                 copy=copy),
   4455                          placement=placement)
-&gt; 4456               for placement, join_units in concat_plan]
   4457 
   4458     return BlockManager(blocks, axes)

/.../env/local/lib/python2.7/site-packages/pandas/core/internals.py in concatenate_join_units(join_units, concat_axis, copy)
   4551     to_concat = [ju.get_reindexed_values(empty_dtype=empty_dtype,
   4552                                          upcasted_na=upcasted_na)
-&gt; 4553                  for ju in join_units]
   4554 
   4555     if len(to_concat) == 1:

/.../env/local/lib/python2.7/site-packages/pandas/core/internals.py in get_reindexed_values(self, empty_dtype, upcasted_na)
   4799 
   4800             if self.is_null and not getattr(self.block,'is_categorical',None):
-&gt; 4801                 missing_arr = np.empty(self.shape, dtype=empty_dtype)
   4802                 if np.prod(self.shape):
   4803                     # NumPy 1.6 workaround: this statement gets strange if all

TypeError: data type not understood"><pre class="notranslate"><code class="notranslate">In [1]: import pandas as pd
In [2]: df1 = pd.DataFrame([[pd.NaT], [pd.NaT]])
In [3]: df1
Out[2]:
    0
0   NaT
1   NaT
In [4]: df2 = pd.DataFrame([[pd.Timestamp('2015/01/01', tz='UTC')], [pd.Timestamp('2016/01/01', tz='UTC')]])
In [5]: df2
Out[4]:
    0
0   2015-01-01 00:00:00+00:00
1   2016-01-01 00:00:00+00:00
In [6]: pd.concat([df1, df2])

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
&lt;ipython-input-6-f61a1ab4009e&gt; in &lt;module&gt;()
----&gt; 1 pd.concat([df1, df2])

/.../env/local/lib/python2.7/site-packages/pandas/tools/merge.py in concat(objs, axis, join, join_axes, ignore_index, keys, levels, names, verify_integrity, copy)
    811                        verify_integrity=verify_integrity,
    812                        copy=copy)
--&gt; 813     return op.get_result()
    814 
    815 

/.../env/local/lib/python2.7/site-packages/pandas/tools/merge.py in get_result(self)
    993 
    994             new_data = concatenate_block_managers(
--&gt; 995                 mgrs_indexers, self.new_axes, concat_axis=self.axis, copy=self.copy)
    996             if not self.copy:
    997                 new_data._consolidate_inplace()

/.../env/local/lib/python2.7/site-packages/pandas/core/internals.py in concatenate_block_managers(mgrs_indexers, axes, concat_axis, copy)
   4454                                                 copy=copy),
   4455                          placement=placement)
-&gt; 4456               for placement, join_units in concat_plan]
   4457 
   4458     return BlockManager(blocks, axes)

/.../env/local/lib/python2.7/site-packages/pandas/core/internals.py in concatenate_join_units(join_units, concat_axis, copy)
   4551     to_concat = [ju.get_reindexed_values(empty_dtype=empty_dtype,
   4552                                          upcasted_na=upcasted_na)
-&gt; 4553                  for ju in join_units]
   4554 
   4555     if len(to_concat) == 1:

/.../env/local/lib/python2.7/site-packages/pandas/core/internals.py in get_reindexed_values(self, empty_dtype, upcasted_na)
   4799 
   4800             if self.is_null and not getattr(self.block,'is_categorical',None):
-&gt; 4801                 missing_arr = np.empty(self.shape, dtype=empty_dtype)
   4802                 if np.prod(self.shape):
   4803                     # NumPy 1.6 workaround: this statement gets strange if all

TypeError: data type not understood
</code></pre></div>
<p dir="auto">Possibly related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="118654562" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/11693" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/11693/hovercard" href="https://github.com/pandas-dev/pandas/issues/11693">#11693</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="118959525" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/11705" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/11705/hovercard" href="https://github.com/pandas-dev/pandas/pull/11705">#11705</a> and the  <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="113815177" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/11456" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/11456/hovercard" href="https://github.com/pandas-dev/pandas/issues/11456">#11456</a> family. However, this doesn't appear to be caused by the TZ-aware vs. non-TZ aware problems referenced there.<br>
Versions:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [4]: pd.show_versions()


INSTALLED VERSIONS
------------------
commit: None
python: 2.7.6.final.0
python-bits: 64
OS: Linux
OS-release: 3.13.0-77-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8

pandas: 0.17.1
nose: 1.3.6
pip: 6.0.8
setuptools: 12.0.5
Cython: 0.22
numpy: 1.9.2
scipy: 0.15.1
statsmodels: 0.6.1.post1
IPython: 3.1.0
sphinx: 1.3.1
patsy: 0.2.1
dateutil: 2.4.2
pytz: 2015.4
blosc: 1.2.8
bottleneck: 1.0.0
tables: 3.2.0
numexpr: 2.4.3
matplotlib: None
openpyxl: None
xlrd: 0.9.3
xlwt: 0.7.5
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
Jinja2: None"><pre class="notranslate"><code class="notranslate">In [4]: pd.show_versions()


INSTALLED VERSIONS
------------------
commit: None
python: 2.7.6.final.0
python-bits: 64
OS: Linux
OS-release: 3.13.0-77-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8

pandas: 0.17.1
nose: 1.3.6
pip: 6.0.8
setuptools: 12.0.5
Cython: 0.22
numpy: 1.9.2
scipy: 0.15.1
statsmodels: 0.6.1.post1
IPython: 3.1.0
sphinx: 1.3.1
patsy: 0.2.1
dateutil: 2.4.2
pytz: 2015.4
blosc: 1.2.8
bottleneck: 1.0.0
tables: 3.2.0
numexpr: 2.4.3
matplotlib: None
openpyxl: None
xlrd: 0.9.3
xlwt: 0.7.5
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
Jinja2: None
</code></pre></div>