<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, duplicates being eliminated from a list</title>
    <link>http://www.mapleprimes.com/questions/35589-Duplicates-Being-Eliminated-From-A-List</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Fri, 12 Jun 2026 00:02:15 GMT</lastBuildDate>
    <pubDate>Fri, 12 Jun 2026 00:02:15 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, duplicates being eliminated from a list</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, duplicates being eliminated from a list</title>
      <link>http://www.mapleprimes.com/questions/35589-Duplicates-Being-Eliminated-From-A-List</link>
    </image>
    <item>
      <title>ListTools</title>
      <link>http://www.mapleprimes.com/questions/35589-Duplicates-Being-Eliminated-From-A-List?ref=Feed:MaplePrimes:duplicates being eliminated from a list:Comments#answer44369</link>
      <itunes:summary>&lt;p&gt;The ListTools package has a routine for doing just this: ListTools:-MakeUnique&lt;/p&gt;
&lt;pre&gt;
(**) L := [1,2,3,4,3,2,3,4,5,4,3,4,5,6];

               L := [1, 2, 3, 4, 3, 2, 3, 4, 5, 4, 3, 4, 5, 6]

(**) ListTools:-MakeUnique(L);

                             [1, 2, 3, 4, 5, 6]

&lt;/pre&gt;
&lt;p&gt;John&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;The ListTools package has a routine for doing just this: ListTools:-MakeUnique&lt;/p&gt;
&lt;pre&gt;
(**) L := [1,2,3,4,3,2,3,4,5,4,3,4,5,6];

               L := [1, 2, 3, 4, 3, 2, 3, 4, 5, 4, 3, 4, 5, 6]

(**) ListTools:-MakeUnique(L);

                             [1, 2, 3, 4, 5, 6]

&lt;/pre&gt;
&lt;p&gt;John&lt;/p&gt;</description>
      <guid>44369</guid>
      <pubDate>Thu, 04 Mar 2010 20:50:17 Z</pubDate>
      <itunes:author>jpmay</itunes:author>
      <author>jpmay</author>
    </item>
    <item>
      <title>Removing duplicates</title>
      <link>http://www.mapleprimes.com/questions/35589-Duplicates-Being-Eliminated-From-A-List?ref=Feed:MaplePrimes:duplicates being eliminated from a list:Comments#answer44370</link>
      <itunes:summary>&lt;p&gt;&lt;span style="font-family: monospace;"&gt;I might try something like this.&amp;nbsp; Go through your list L and check, for each element, whether that &lt;/span&gt;element is a duplicate of one that occurs earlier.&amp;nbsp; You can do that using the three-argument form of &lt;b&gt;member&lt;/b&gt;, since&amp;nbsp; &lt;/p&gt;
&lt;pre&gt;
&amp;gt; member(L[i], L, 'j');
&lt;/pre&gt;
&lt;p&gt;will leave j as the first position where L[i] occurs in the list L.&amp;nbsp; Keep track of those i for which that is true.&amp;nbsp; Then use &lt;b&gt;subsop&lt;/b&gt; to remove the duplicate entries.&amp;nbsp; For efficiency, just use one &lt;b&gt;subsop: &lt;/b&gt;if you want to remove entries number i1, i2, ..., ik, then&lt;/p&gt;
&lt;pre&gt;
&amp;gt; subsop(i1=NULL, i2=NULL, ..., ik=NULL, L)
&lt;/pre&gt;
&lt;p&gt;will do it.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&lt;span style="font-family: monospace;"&gt;I might try something like this.&amp;nbsp; Go through your list L and check, for each element, whether that &lt;/span&gt;element is a duplicate of one that occurs earlier.&amp;nbsp; You can do that using the three-argument form of &lt;b&gt;member&lt;/b&gt;, since&amp;nbsp; &lt;/p&gt;
&lt;pre&gt;
&amp;gt; member(L[i], L, 'j');
&lt;/pre&gt;
&lt;p&gt;will leave j as the first position where L[i] occurs in the list L.&amp;nbsp; Keep track of those i for which that is true.&amp;nbsp; Then use &lt;b&gt;subsop&lt;/b&gt; to remove the duplicate entries.&amp;nbsp; For efficiency, just use one &lt;b&gt;subsop: &lt;/b&gt;if you want to remove entries number i1, i2, ..., ik, then&lt;/p&gt;
&lt;pre&gt;
&amp;gt; subsop(i1=NULL, i2=NULL, ..., ik=NULL, L)
&lt;/pre&gt;
&lt;p&gt;will do it.&lt;/p&gt;</description>
      <guid>44370</guid>
      <pubDate>Thu, 04 Mar 2010 23:50:02 Z</pubDate>
      <itunes:author>Robert Israel</itunes:author>
      <author>Robert Israel</author>
    </item>
    <item>
      <title>list to set to list</title>
      <link>http://www.mapleprimes.com/questions/35589-Duplicates-Being-Eliminated-From-A-List?ref=Feed:MaplePrimes:duplicates being eliminated from a list:Comments#answer44371</link>
      <itunes:summary>&lt;p&gt;What occurs to me is to convert the list L to a set, which removes duplicates, then convert back to a list.&lt;/p&gt;
&lt;p&gt;convert(L,set);convert(%,list);&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;What occurs to me is to convert the list L to a set, which removes duplicates, then convert back to a list.&lt;/p&gt;
&lt;p&gt;convert(L,set);convert(%,list);&lt;/p&gt;</description>
      <guid>44371</guid>
      <pubDate>Fri, 05 Mar 2010 01:02:35 Z</pubDate>
      <itunes:author>Alex
 Smith
</itunes:author>
      <author>Alex
 Smith
</author>
    </item>
    <item>
      <title>Sorry I am a little hopeless</title>
      <link>http://www.mapleprimes.com/questions/35589-Duplicates-Being-Eliminated-From-A-List?ref=Feed:MaplePrimes:duplicates being eliminated from a list:Comments#answer44376</link>
      <itunes:summary>&lt;p&gt;Sorry I am a little hopeless when it comes to maple.&lt;/p&gt;
&lt;p&gt;converting to a set makes sense but I am not sure how it would work with teh example I have&lt;/p&gt;
&lt;p&gt;However in correspondance to the first reply from jpmay i have tried to come up with a procedure however I know it is not correct and was hoping someone would be able to help.&lt;/p&gt;
&lt;p&gt;winnow1:= proc(L)&lt;br /&gt;
local i;&lt;br /&gt;
for i in L do&lt;br /&gt;
if member( L[i], L, 'j') then # 3 argument form of member&lt;br /&gt;
subsop(i1=NULL, i2=NULL, ..., ik=NULL, L) # removes duplicate entries&lt;br /&gt;
end if&lt;br /&gt;
end do;&lt;br /&gt;
return L&lt;br /&gt;
end proc:&lt;/p&gt;
&lt;p&gt;Thanks again.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Sorry I am a little hopeless when it comes to maple.&lt;/p&gt;
&lt;p&gt;converting to a set makes sense but I am not sure how it would work with teh example I have&lt;/p&gt;
&lt;p&gt;However in correspondance to the first reply from jpmay i have tried to come up with a procedure however I know it is not correct and was hoping someone would be able to help.&lt;/p&gt;
&lt;p&gt;winnow1:= proc(L)&lt;br /&gt;
local i;&lt;br /&gt;
for i in L do&lt;br /&gt;
if member( L[i], L, 'j') then # 3 argument form of member&lt;br /&gt;
subsop(i1=NULL, i2=NULL, ..., ik=NULL, L) # removes duplicate entries&lt;br /&gt;
end if&lt;br /&gt;
end do;&lt;br /&gt;
return L&lt;br /&gt;
end proc:&lt;/p&gt;
&lt;p&gt;Thanks again.&lt;/p&gt;</description>
      <guid>44376</guid>
      <pubDate>Fri, 05 Mar 2010 19:34:33 Z</pubDate>
      <itunes:author>mathperson</itunes:author>
      <author>mathperson</author>
    </item>
    <item>
      <title>Alternative</title>
      <link>http://www.mapleprimes.com/questions/35589-Duplicates-Being-Eliminated-From-A-List?ref=Feed:MaplePrimes:duplicates being eliminated from a list:Comments#answer44377</link>
      <itunes:summary>&lt;p&gt;Why not use &lt;a href='http://www.maplesoft.com/support/help/search.aspx?term=ListTools:-MakeUnique,' target='_new'&gt;?ListTools:-MakeUnique,&lt;/a&gt; as John suggested?&amp;nbsp; Of course, learning to roll your own solution is a useful exercise.&amp;nbsp; Here's an &lt;a href="http://www.mapleprimes.com/book/building-up-sets-and-removing-redundant-elements"&gt;interesting approach&lt;/a&gt; described by Roman Pearce.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Why not use &lt;a href='http://www.maplesoft.com/support/help/search.aspx?term=ListTools:-MakeUnique,' target='_new'&gt;?ListTools:-MakeUnique,&lt;/a&gt; as John suggested?&amp;nbsp; Of course, learning to roll your own solution is a useful exercise.&amp;nbsp; Here's an &lt;a href="http://www.mapleprimes.com/book/building-up-sets-and-removing-redundant-elements"&gt;interesting approach&lt;/a&gt; described by Roman Pearce.&lt;/p&gt;</description>
      <guid>44377</guid>
      <pubDate>Fri, 05 Mar 2010 20:17:16 Z</pubDate>
      <itunes:author>Joe
 Riel
</itunes:author>
      <author>Joe
 Riel
</author>
    </item>
    <item>
      <title>list to set to list</title>
      <link>http://www.mapleprimes.com/questions/35589-Duplicates-Being-Eliminated-From-A-List?ref=Feed:MaplePrimes:duplicates being eliminated from a list:Comments#comment44372</link>
      <itunes:summary>&lt;p&gt;That's fine if you don't care what order the elements are in.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;That's fine if you don't care what order the elements are in.&lt;/p&gt;</description>
      <guid>44372</guid>
      <pubDate>Fri, 05 Mar 2010 04:19:29 Z</pubDate>
      <itunes:author>Robert Israel</itunes:author>
      <author>Robert Israel</author>
    </item>
  </channel>
</rss>