Re: data matrix python

2009-10-08 Thread lallous

Hello

Try re-asking your question in a more general way so that users w/o 
background information (about those classes and modules you're using) can 
help you with your problem.


--
Elias
bbarb...@inescporto.pt wrote in message 
news:mailman.968.1254922056.2807.python-l...@python.org...

Good morning all!

I am trying to build a data matrix, but I am not able either to write  to 
file with a proper structure nor to get the data from the matrix.


I want to sort some music by similarity content, and I just have the 
indexes of the playlist like this:


dm = numpy.array(songs)

[0 4 2 1 3]
[1 2 0 4 3]
[2 1 0 4 3]
[3 2 1 0 4]
[4 0 1 2 3]

Now, I want to keep the same format but with the names of the songs, 
something like this:


Sort_dm.append(songlist(dm))

['100.mp3\n' '10008.mp3' '10005.mp3\n' '10001.mp3\n' '10006.mp3\n'
 '10001.mp3\n' '10005.mp3\n' '100.mp3\n' '10008.mp3' '10006.mp3\n'
 '10005.mp3\n' '10001.mp3\n' '100.mp3\n' '10008.mp3' '10006.mp3\n'
 '10006.mp3\n' '10005.mp3\n' '10001.mp3\n' '100.mp3\n' '10008.mp3'
 '10008.mp3' '100.mp3\n' '10001.mp3\n' '10005.mp3\n' '10006.mp3\n']

But there is no way either I can access to the data... because there  are 
strings, or save them in matrix format! I could not find anything  in the 
documentation about this! any hint would be very welcome! thank  you for 
your time!


Best regards,
Bea Mora



This message was sent using IMP, the Internet Messaging Program. 


--
http://mail.python.org/mailman/listinfo/python-list


data matrix python

2009-10-07 Thread bbarbero

Good morning all!

I am trying to build a data matrix, but I am not able either to write  
to file with a proper structure nor to get the data from the matrix.


I want to sort some music by similarity content, and I just have the  
indexes of the playlist like this:


dm = numpy.array(songs)

[0 4 2 1 3]
[1 2 0 4 3]
[2 1 0 4 3]
[3 2 1 0 4]
[4 0 1 2 3]

Now, I want to keep the same format but with the names of the songs,  
something like this:


Sort_dm.append(songlist(dm))

['100.mp3\n' '10008.mp3' '10005.mp3\n' '10001.mp3\n' '10006.mp3\n'
 '10001.mp3\n' '10005.mp3\n' '100.mp3\n' '10008.mp3' '10006.mp3\n'
 '10005.mp3\n' '10001.mp3\n' '100.mp3\n' '10008.mp3' '10006.mp3\n'
 '10006.mp3\n' '10005.mp3\n' '10001.mp3\n' '100.mp3\n' '10008.mp3'
 '10008.mp3' '100.mp3\n' '10001.mp3\n' '10005.mp3\n' '10006.mp3\n']

But there is no way either I can access to the data... because there  
are strings, or save them in matrix format! I could not find anything  
in the documentation about this! any hint would be very welcome! thank  
you for your time!


Best regards,
Bea Mora



This message was sent using IMP, the Internet Messaging Program.
--
http://mail.python.org/mailman/listinfo/python-list


Re: data matrix python

2009-10-07 Thread Robert Kern

On 2009-10-07 05:46 AM, bbarb...@inescporto.pt wrote:

Good morning all!

I am trying to build a data matrix, but I am not able either to write to
file with a proper structure nor to get the data from the matrix.

I want to sort some music by similarity content, and I just have the
indexes of the playlist like this:

dm = numpy.array(songs)

[0 4 2 1 3]
[1 2 0 4 3]
[2 1 0 4 3]
[3 2 1 0 4]
[4 0 1 2 3]

Now, I want to keep the same format but with the names of the songs,
something like this:

Sort_dm.append(songlist(dm))

['100.mp3\n' '10008.mp3' '10005.mp3\n' '10001.mp3\n' '10006.mp3\n'
'10001.mp3\n' '10005.mp3\n' '100.mp3\n' '10008.mp3' '10006.mp3\n'
'10005.mp3\n' '10001.mp3\n' '100.mp3\n' '10008.mp3' '10006.mp3\n'
'10006.mp3\n' '10005.mp3\n' '10001.mp3\n' '100.mp3\n' '10008.mp3'
'10008.mp3' '100.mp3\n' '10001.mp3\n' '10005.mp3\n' '10006.mp3\n']

But there is no way either I can access to the data... because there are
strings, or save them in matrix format! I could not find anything in the
documentation about this! any hint would be very welcome! thank you for
your time!


You will want to ask numpy questions on the numpy mailing list:

  http://www.scipy.org/Mailing_Lists

However, you will need to show a little more code for us to understand what you 
are trying to do. Show us the code that you have, show us what results you get 
(copy-and-paste, please), and tell us what results you expect to get.


--
Robert Kern

I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth.
  -- Umberto Eco

--
http://mail.python.org/mailman/listinfo/python-list