<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Plotting a Spatially Enabled DataFrame w/ datetime column with all NaT values causes exception in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/plotting-a-spatially-enabled-dataframe-w-datetime/m-p/540297#M42231</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This isn't really a question since this might be the&amp;nbsp;expected behavior, but since I spent a good chunk of time pinpointing the problem, figured I'd share.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was playing around with SEDFs and had some issues plotting a SEDF that had NaT datetime values. The error it gave was&amp;nbsp;&lt;/P&gt;&lt;UL style="margin-left: 1.125in; direction: ltr; unicode-bidi: embed; margin-top: 0in; margin-bottom: 0in;" type="disc"&gt;&lt;LI style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"&gt;&lt;SPAN style="font-family: Calibri; font-size: 11.0pt;"&gt;AttributeError: Can only use .str accessor with string values, which use np.object_ dtype in pandas&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; font-size: 11.0pt;"&gt;This seems to only be an issue if all the values in a datetime column are NaT. I won't go into details why, but there was a datetime column that didn't have a single valid datetime value, all values were null/NaT.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; font-size: 11.0pt;"&gt;So, the following line of code was causing the error&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;sdf&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;spatial&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;plot&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;map_widget&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;m1&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Jul 2019 20:46:46 GMT</pubDate>
    <dc:creator>JimmyKnowles</dc:creator>
    <dc:date>2019-07-30T20:46:46Z</dc:date>
    <item>
      <title>Plotting a Spatially Enabled DataFrame w/ datetime column with all NaT values causes exception</title>
      <link>https://community.esri.com/t5/python-questions/plotting-a-spatially-enabled-dataframe-w-datetime/m-p/540297#M42231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This isn't really a question since this might be the&amp;nbsp;expected behavior, but since I spent a good chunk of time pinpointing the problem, figured I'd share.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was playing around with SEDFs and had some issues plotting a SEDF that had NaT datetime values. The error it gave was&amp;nbsp;&lt;/P&gt;&lt;UL style="margin-left: 1.125in; direction: ltr; unicode-bidi: embed; margin-top: 0in; margin-bottom: 0in;" type="disc"&gt;&lt;LI style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"&gt;&lt;SPAN style="font-family: Calibri; font-size: 11.0pt;"&gt;AttributeError: Can only use .str accessor with string values, which use np.object_ dtype in pandas&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; font-size: 11.0pt;"&gt;This seems to only be an issue if all the values in a datetime column are NaT. I won't go into details why, but there was a datetime column that didn't have a single valid datetime value, all values were null/NaT.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri; font-size: 11.0pt;"&gt;So, the following line of code was causing the error&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;sdf&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;spatial&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;plot&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;map_widget&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;m1&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jul 2019 20:46:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/plotting-a-spatially-enabled-dataframe-w-datetime/m-p/540297#M42231</guid>
      <dc:creator>JimmyKnowles</dc:creator>
      <dc:date>2019-07-30T20:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting a Spatially Enabled DataFrame w/ datetime column with all NaT values causes exception</title>
      <link>https://community.esri.com/t5/python-questions/plotting-a-spatially-enabled-dataframe-w-datetime/m-p/1412104#M70376</link>
      <description>&lt;P&gt;Thank you for posting this.&amp;nbsp; &amp;nbsp;I expired the same thing but with anoter columns.&amp;nbsp; IAnd 'I have struggeled a lot until I find this post.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 07:20:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/plotting-a-spatially-enabled-dataframe-w-datetime/m-p/1412104#M70376</guid>
      <dc:creator>BjørnSteen</dc:creator>
      <dc:date>2024-04-19T07:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting a Spatially Enabled DataFrame w/ datetime column with all NaT values causes exception</title>
      <link>https://community.esri.com/t5/python-questions/plotting-a-spatially-enabled-dataframe-w-datetime/m-p/1412105#M70377</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Experienced&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 07:21:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/plotting-a-spatially-enabled-dataframe-w-datetime/m-p/1412105#M70377</guid>
      <dc:creator>BjørnSteen</dc:creator>
      <dc:date>2024-04-19T07:21:57Z</dc:date>
    </item>
  </channel>
</rss>

