<?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 Randomly split the polygon layer in a ratio of 80% to 20%. in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/randomly-split-the-polygon-layer-in-a-ratio-of-80/m-p/1205361#M58937</link>
    <description>&lt;P&gt;Hi all, Im working with ArcGIS Pro 3.0.0. I have polygon layer with 5400 attributes, and I need&amp;nbsp; to split them randomly in ration of 80% to 20%, so than I will have two polygon layers with 4320 attributes and 1080.&lt;/P&gt;&lt;P&gt;What can I use for the random split?&lt;/P&gt;&lt;P&gt;Thank you all!&lt;/P&gt;&lt;P&gt;Have a nice day.&lt;/P&gt;</description>
    <pubDate>Tue, 23 Aug 2022 13:39:32 GMT</pubDate>
    <dc:creator>JúliaMatejčíková</dc:creator>
    <dc:date>2022-08-23T13:39:32Z</dc:date>
    <item>
      <title>Randomly split the polygon layer in a ratio of 80% to 20%.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/randomly-split-the-polygon-layer-in-a-ratio-of-80/m-p/1205361#M58937</link>
      <description>&lt;P&gt;Hi all, Im working with ArcGIS Pro 3.0.0. I have polygon layer with 5400 attributes, and I need&amp;nbsp; to split them randomly in ration of 80% to 20%, so than I will have two polygon layers with 4320 attributes and 1080.&lt;/P&gt;&lt;P&gt;What can I use for the random split?&lt;/P&gt;&lt;P&gt;Thank you all!&lt;/P&gt;&lt;P&gt;Have a nice day.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 13:39:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/randomly-split-the-polygon-layer-in-a-ratio-of-80/m-p/1205361#M58937</guid>
      <dc:creator>JúliaMatejčíková</dc:creator>
      <dc:date>2022-08-23T13:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: Randomly split the polygon layer in a ratio of 80% to 20%.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/randomly-split-the-polygon-layer-in-a-ratio-of-80/m-p/1205397#M58946</link>
      <description>&lt;P&gt;This Python script will create 2 layers (named "20%" and "80%") in your ArcGIS Pro map. These show the input features, but with a definition query. If you want to save those subsets, right-click on the layers and export data.&lt;/P&gt;&lt;P&gt;Copy/paste the script into the Python window, edit the in_features variable, run it.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;in_features = "EZG"  # path to the featureclass or name of the layer

import random
# get all objectids
oids = [row[0] for row in arcpy.da.SearchCursor(in_features, ["OBJECTID"])]
# get a random sample
oids_80 = random.sample(oids, int(0.8 * len(oids)))
# create the layers
arcpy.management.MakeFeatureLayer(in_features, "80%", f"OBJECTID IN {tuple(oids_80)}")
arcpy.management.MakeFeatureLayer(in_features, "20%", f"OBJECTID NOT IN {tuple(oids_80)}")&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 23 Aug 2022 14:30:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/randomly-split-the-polygon-layer-in-a-ratio-of-80/m-p/1205397#M58946</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-08-23T14:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Randomly split the polygon layer in a ratio of 80% to 20%.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/randomly-split-the-polygon-layer-in-a-ratio-of-80/m-p/1205752#M58994</link>
      <description>&lt;P&gt;Thank you! It works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a nice day!&lt;/P&gt;&lt;P&gt;Júlia&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 11:14:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/randomly-split-the-polygon-layer-in-a-ratio-of-80/m-p/1205752#M58994</guid>
      <dc:creator>JúliaMatejčíková</dc:creator>
      <dc:date>2022-08-24T11:14:16Z</dc:date>
    </item>
  </channel>
</rss>

