473,395 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Comparing modified elements in Sets

I've got a set with contents like: [filename1.mp3, filename2.mp3,
filename3.mp3, ...]
I've got another set with contents like [filename1.ogg,
filename3.ogg, ...]
And another set with contents like [filename1, filename 2, ...]

I'd like to be able to compare set 1 with set 2 and have it match
filename1 and filename3, or compare set 1 with 3 and get back
filename1, filename2. etc.

Is there a way for me to do this inside the compare function, rather
than having to make duplicate copies of each set?

Jul 9 '07 #1
2 1053
On Mon, 09 Jul 2007 19:57:14 +0000, ChrisEdgemon wrote:
I've got a set with contents like: [filename1.mp3, filename2.mp3,
filename3.mp3, ...]
I've got another set with contents like [filename1.ogg,
filename3.ogg, ...]
And another set with contents like [filename1, filename 2, ...]

I'd like to be able to compare set 1 with set 2 and have it match
filename1 and filename3, or compare set 1 with 3 and get back
filename1, filename2. etc.

Is there a way for me to do this inside the compare function, rather
than having to make duplicate copies of each set?
What compare function are you talking about?

Unless you have truly astronomical numbers of unique filenames (and
remember that what's big to you is probably not big to Python), the
easiest way is to make a copy of each set with the file extensions
stripped off the file names. Use os.path.splitext() for that.
--
Steven.

Jul 9 '07 #2
On Jul 9, 2:57 pm, ChrisEdge...@gmail.com wrote:
I've got a set with contents like: [filename1.mp3, filename2.mp3,
filename3.mp3, ...]
I've got another set with contents like [filename1.ogg,
filename3.ogg, ...]
And another set with contents like [filename1, filename 2, ...]

I'd like to be able to compare set 1 with set 2 and have it match
filename1 and filename3, or compare set 1 with 3 and get back
filename1, filename2. etc.

Is there a way for me to do this inside the compare function, rather
than having to make duplicate copies of each set?
<A HREF="resumepage.html">my resume</A

Jul 9 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Doug | last post by:
I need to compare two "address" structures within a document, and perform some action if they are not equal. The XML document is a purchase order, with an address at both the header and line...
41
by: Odd-R. | last post by:
I have to lists, A and B, that may, or may not be equal. If they are not identical, I want the output to be three new lists, X,Y and Z where X has all the elements that are in A, but not in B, and...
2
by: Yash | last post by:
Hi, We are in the process of tuning the performance of our stored procs in SQL 2000 and are looking for a tool that would help us in comparing the result sets of an old SP and a modified SP. The...
1
by: Yash | last post by:
Hi, We are in the process of tuning the performance of our stored procs in SQL 2000 and are looking for a tool that would help us in comparing the result sets of an old SP and a modified SP. The...
3
by: Sean Dalton | last post by:
Hello, I have a two sets OLDLIST and REMOVE. I would like to remove every element in OLDLIST if it is also occuring in REMOVE and store the remaining elements from OLDLIST into NEWLIST. So...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.