<?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: Need to understand the pseudocode in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/need-to-understand-the-pseudocode/m-p/1178412#M64667</link>
    <description>&lt;P&gt;Thanks, appreciate your answer.&lt;/P&gt;</description>
    <pubDate>Tue, 31 May 2022 04:14:49 GMT</pubDate>
    <dc:creator>MaryamZakeri</dc:creator>
    <dc:date>2022-05-31T04:14:49Z</dc:date>
    <item>
      <title>Need to understand the pseudocode</title>
      <link>https://community.esri.com/t5/python-questions/need-to-understand-the-pseudocode/m-p/1178389#M64665</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I have two sets of Origin and Destination locations (Longitude, Latitude + ID) for more than 6000 trips and I want to cluster them using GMM, based on their locations. In other words, trips with similar OD pairs will be in the same cluster.&lt;/P&gt;&lt;P&gt;I asked a friend to tell me how to have OD pairs presented as the input to the GMM algorithm and they gave me the below pseudocode that I cannot figure out. Can anyone help me figure out what to do to develop the code? I am not super proficient with &lt;STRONG&gt;python&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Or if there is any other way that you can help me to achieve my purpose, I'd appreciate it if you could share.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="helvetica" color="#333399"&gt;&lt;EM&gt;You'll need 2 sets, You're name of CSV file, And a hadhmap:&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="helvetica" color="#333399"&gt;&lt;EM&gt;Map clusterOD(filename){&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="helvetica" color="#333399"&gt;&lt;EM&gt;Arr = readCsv(filename) //array[n][2]&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="helvetica" color="#333399"&gt;&lt;EM&gt;Originset&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="helvetica" color="#333399"&gt;&lt;EM&gt;DesSet&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="helvetica" color="#333399"&gt;&lt;EM&gt;Omean &lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="helvetica" color="#333399"&gt;&lt;EM&gt;DMean&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="helvetica" color="#333399"&gt;&lt;EM&gt;// Floating mean &lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="helvetica" color="#333399"&gt;&lt;EM&gt;For I in range(sizeof(arr)){&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="helvetica" color="#333399"&gt;&lt;EM&gt;N = 1 &lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="helvetica" color="#333399"&gt;&lt;EM&gt;For j in range(I, sizeof(arr)) &lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="helvetica" color="#333399"&gt;&lt;EM&gt;{ &lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="helvetica" color="#333399"&gt;&lt;EM&gt;//Gets all means and adds to set &lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="helvetica" color="#333399"&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="helvetica" color="#333399"&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="helvetica" color="#333399"&gt;&lt;EM&gt;Map&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="helvetica" color="#333399"&gt;&lt;EM&gt;//Permutati &lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="helvetica" color="#333399"&gt;&lt;EM&gt;Add to hadhmap &lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="helvetica" color="#333399"&gt;&lt;EM&gt;Sort and grav&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 22:08:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/need-to-understand-the-pseudocode/m-p/1178389#M64665</guid>
      <dc:creator>MaryamZakeri</dc:creator>
      <dc:date>2022-05-30T22:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: Need to understand the pseudocode</title>
      <link>https://community.esri.com/t5/python-questions/need-to-understand-the-pseudocode/m-p/1178408#M64666</link>
      <description>&lt;P&gt;The best interpreter would be the author of the pseudo code. Send it back and ask for clarification? The syntax isn’t python either, but you have a method with an argument, variable(s) and a for loop… which is not very helpful.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Towards data science/medium has a pretty comprehensive example of working with spatial data to get you started:&amp;nbsp;&lt;BR /&gt;&lt;A href="https://towardsdatascience.com/gmm-gaussian-mixture-models-how-to-successfully-use-it-to-cluster-your-data-891dc8ac058f" target="_self"&gt;gmm-gaussian-mixture-models-how-to-successfully-use-it-to-cluster-your-data&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I’d suggest scraping the pseudo code and work through the example.&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 03:50:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/need-to-understand-the-pseudocode/m-p/1178408#M64666</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-05-31T03:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: Need to understand the pseudocode</title>
      <link>https://community.esri.com/t5/python-questions/need-to-understand-the-pseudocode/m-p/1178412#M64667</link>
      <description>&lt;P&gt;Thanks, appreciate your answer.&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 04:14:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/need-to-understand-the-pseudocode/m-p/1178412#M64667</guid>
      <dc:creator>MaryamZakeri</dc:creator>
      <dc:date>2022-05-31T04:14:49Z</dc:date>
    </item>
  </channel>
</rss>

