<?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 Re: Calculate number of days in date attribute? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/calculate-number-of-days-in-date-attribute/m-p/1271934#M8555</link>
    <description>&lt;P&gt;If you can load your data into a &lt;STRONG&gt;pandas &lt;/STRONG&gt;DataFrame (a "GeoAccessor" in the Python API), it's simple:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.features import GeoAccessor

# load layer into dataframe
df = GeoAccessor.from_featureclass('path/to/fc')

# create new date field, dropping time
df['the_date'] = df['your_datetime_field'].dt.date

# get the count
df.groupby('the_date').count()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Mar 2023 15:02:10 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2023-03-27T15:02:10Z</dc:date>
    <item>
      <title>Calculate number of days in date attribute?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/calculate-number-of-days-in-date-attribute/m-p/1271927#M8553</link>
      <description>&lt;P&gt;I have a dataset that contains a date attribute and records show date/time. How can I count then number of unique dates while disregarding the time stamp?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 14:52:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/calculate-number-of-days-in-date-attribute/m-p/1271927#M8553</guid>
      <dc:creator>avonmoos</dc:creator>
      <dc:date>2023-03-27T14:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate number of days in date attribute?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/calculate-number-of-days-in-date-attribute/m-p/1271934#M8555</link>
      <description>&lt;P&gt;If you can load your data into a &lt;STRONG&gt;pandas &lt;/STRONG&gt;DataFrame (a "GeoAccessor" in the Python API), it's simple:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.features import GeoAccessor

# load layer into dataframe
df = GeoAccessor.from_featureclass('path/to/fc')

# create new date field, dropping time
df['the_date'] = df['your_datetime_field'].dt.date

# get the count
df.groupby('the_date').count()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 15:02:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/calculate-number-of-days-in-date-attribute/m-p/1271934#M8555</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2023-03-27T15:02:10Z</dc:date>
    </item>
  </channel>
</rss>

