<?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: AttributeError: module 'numpy' has no attribute 'str' in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/attributeerror-module-numpy-has-no-attribute-str/m-p/1247975#M64227</link>
    <description>&lt;P&gt;sort_values(by=&lt;/P&gt;&lt;P&gt;doesn't look correct&lt;/P&gt;</description>
    <pubDate>Fri, 13 Jan 2023 10:35:59 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2023-01-13T10:35:59Z</dc:date>
    <item>
      <title>AttributeError: module 'numpy' has no attribute 'str'</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attributeerror-module-numpy-has-no-attribute-str/m-p/1247961#M64226</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;When trying to run this in VS code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;m = GIS().map("Vellinge Trangränden", zoomlevel = 16)
m.basemap = 'satellite'
m.center = [55.472155,13.032001]

pd.DataFrame.spatial.from_featureclass(arcpy.env.workspace + "\\Fastighetsgränser_pgon").sort_values(by="Fastighetsägare").spatial.plot(map_widget = m,
    col = 'Fastighetsägare',
    renderer_type = 's',
    #cmap = "Blues",
    alpha = 0.2,
    #polygon_color = [0,0,0,255],
    outline_color = [0,0,0,100],
    outline_width = 0.05
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the following error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;c:\Users\user\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone-1\lib\site-packages\arcgis\auth\tools\_lazy.py:48: FutureWarning:

In the future `np.str` will be defined as the corresponding NumPy scalar. (This may have returned Python scalars in past versions.

Output exceeds the size limit. Open the full output data in a text editor
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
&amp;lt;ipython-input-13-404f875978ff&amp;gt; in &amp;lt;module&amp;gt;
3 m.center = [55.472155,13.032001]
4
----&amp;gt; 5 pd.DataFrame.spatial.from_featureclass(arcpy.env.workspace + "\\Fastighetsgränser_pgon").sort_values(by="Fastighetsägare").spatial.plot(map_widget = m,
6 # col = 'Fastighetsägare',
7 # renderer_type = 's',

c:\Users\user\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone-1\lib\site-packages\arcgis\features\geo\_accessor.py in plot(self, map_widget, **kwargs)
2311 self._data.columns = [c.replace(" ", "_") for c in self._data.columns]
2312 # plot and be merry
-&amp;gt; 2313 _plot_map_widget(map_widget)
2314 self._data.columns = orig_col
2315 return True

c:\Users\user\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone-1\lib\site-packages\arcgis\features\geo\_accessor.py in _plot_map_widget(mp_wdgt)
2279 # small helper to consolidate the plotting function
2280 def _plot_map_widget(mp_wdgt):
-&amp;gt; 2281 plot(
2282 df=self._data,
2283 map_widget=mp_wdgt,

c:\Users\user\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone-1\lib\site-packages\arcgis\features\geo\_viz\mapping.py in plot(df, map_widget, name, renderer_type, symbol_type, symbol_style, col, colors, alpha, **kwargs)
192 col_old = df.columns.tolist()
...
--&amp;gt; 284 raise AttributeError("module {!r} has no attribute "
285 "{!r}".format(__name__, attr))
286

AttributeError: module 'numpy' has no attribute 'str'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From Python for the complete error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Traceback (most recent call last):
  File "n:\PDOC\Vellinge Herrestorp 6_1\22649_ Borrhålsdimensionering\24_Beräkningar\ArcGIS\test_error_numpy.py", line 19, in &amp;lt;module&amp;gt;
    pd.DataFrame.spatial.from_featureclass(arcpy.env.workspace + "\\Fastighetsgränser_pgon").sort_values(by='Fastighetsägare').spatial.plot(map_widget = m,
  File "C:\Users\user\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone-1\lib\site-packages\arcgis\features\geo\_accessor.py", line 2313, in plot
    _plot_map_widget(map_widget)
  File "C:\Users\user\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone-1\lib\site-packages\arcgis\features\geo\_accessor.py", line 2281, in _plot_map_widget
    plot(
  File "C:\Users\user\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone-1\lib\site-packages\arcgis\features\geo\_viz\mapping.py", line 194, in plot
    fc = df.spatial.to_feature_collection(name=name)
  File "C:\Users\user\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone-1\lib\site-packages\arcgis\features\geo\_accessor.py", line 3226, in to_feature_collection
    fs = self.__feature_set__
  File "C:\Users\user\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone-1\lib\site-packages\arcgis\features\geo\_accessor.py", line 2989, in __feature_set__
    if isinstance(col_val, (str, np.str)) and not col in date_cols:
  File "C:\Users\user\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone-1\lib\site-packages\arcgis\auth\tools\_lazy.py", line 48, in __getattr__
    return getattr(self._load(), attrb)
  File "C:\Users\user\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone-1\lib\site-packages\numpy\__init__.py", line 284, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'str'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think, this is related to this issue:&lt;/P&gt;&lt;P&gt;&lt;A href="https://levelup.gitconnected.com/fix-attributeerror-module-numpy-has-no-attribute-float-d7d68c5a4971" target="_blank" rel="noopener"&gt;https://levelup.gitconnected.com/fix-attributeerror-module-numpy-has-no-attribute-float-d7d68c5a4971&lt;/A&gt;&lt;/P&gt;&lt;P&gt;but I am unsure how to fix it in my case.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I recently upgraded ArcGis Pro to v3.0.3 which uses Python 3.9&lt;/LI&gt;&lt;LI&gt;Env: arcgis-py3-clone-1&lt;/LI&gt;&lt;LI&gt;numpy version: 1.24.1 according to pip, 1.20.1 according to the Package Manager in ArcGIS&lt;/LI&gt;&lt;LI&gt;I have a warning filter:&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;warnings.filterwarnings("ignore", message=r"Passing", category=FutureWarning)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Grateful for any help on this issue!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 09:38:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attributeerror-module-numpy-has-no-attribute-str/m-p/1247961#M64226</guid>
      <dc:creator>BengtDahlgrenStockholmGeo</dc:creator>
      <dc:date>2023-01-13T09:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: AttributeError: module 'numpy' has no attribute 'str'</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attributeerror-module-numpy-has-no-attribute-str/m-p/1247975#M64227</link>
      <description>&lt;P&gt;sort_values(by=&lt;/P&gt;&lt;P&gt;doesn't look correct&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 10:35:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attributeerror-module-numpy-has-no-attribute-str/m-p/1247975#M64227</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-01-13T10:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: AttributeError: module 'numpy' has no attribute 'str'</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attributeerror-module-numpy-has-no-attribute-str/m-p/1248001#M64228</link>
      <description>&lt;P&gt;Thank you for your answer.&lt;/P&gt;&lt;P&gt;I solved it by removing the np.str and np.int instances in the _accessor.py files, since these will be /are anyway deprecated according to the FutureWarning. Not sure if this is a sustainable solution though.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 12:18:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attributeerror-module-numpy-has-no-attribute-str/m-p/1248001#M64228</guid>
      <dc:creator>BengtDahlgrenStockholmGeo</dc:creator>
      <dc:date>2023-01-13T12:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: AttributeError: module 'numpy' has no attribute 'str'</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attributeerror-module-numpy-has-no-attribute-str/m-p/1248017#M64231</link>
      <description>&lt;P&gt;It will have to be, since np.str and np.int are being removed, hence the warning you are getting now.&amp;nbsp; When they are deprecated, you will just get an error message&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2023 13:10:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attributeerror-module-numpy-has-no-attribute-str/m-p/1248017#M64231</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-01-13T13:10:46Z</dc:date>
    </item>
  </channel>
</rss>

