speed up linecache.getline()

2009-10-13 Thread bbarbero
Hi Everyone!! I am using linecache.getline, to access to a line in a long file. It s really fast, appx 4seconds, but I was just wandering if any of you, know either another way, or there is something that I can do to speed it up... thank you very much for your help!! Regards, Bea

Multi-arrays python

2009-10-08 Thread bbarbero
Hi again! After testing the whole day, I have got my goals from the last email, but as always, another issues came up! and now that Ive been able to save a list of list (or multi-arrays) as below : ['100.mp3\n' '10008.mp3\n' '10005.mp3\n' '10001.mp3\n' '10006.mp3\n'] ['10001.mp3\n'

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

unexpected token `;'

2009-08-25 Thread bbarbero
Hello to all! I am struggling with a script in python for a while now, and decided to look for some help. I am running a code that takes commands from Marsyas(open source for Music analysis). #!/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6 #!/bin/bashimport math import re

Extracting matrix from a text file

2009-08-07 Thread bbarbero
Hello to all!! I am new in python, and I am running it on Mac with Smultron editor. I need to read a textfile that includes numbers (in a matrix form), indexes, and strings, like this: Marsyas-kea distance matrix for MIREX 2007 Audio Similarity Exchange Q/R 1 2 3 4

Problems in commands.getoutput(cmd) with sox

2009-07-23 Thread bbarbero
Hello to all! I am a new researcher, new to Python as well, and I have a problem, when I try to get commands from sox in a python script. I am going crazy, because this code has been working before.. so I dont really know whats going on.. Ive already seen some solutions that match with