python Programming Glossary: ds
custom matplotlib plot : chess board like table with colored cells http://stackoverflow.com/questions/10194482/custom-matplotlib-plot-chess-board-like-table-with-colored-cells substituting the values in the cells from a numpy pandas ds. Sample Plot http picpaste.com sample E0DZaoXk.png Appreciate.. of values plotted as some constant color Update It sounds like you want something more like a spreasheet Matplotlib isn't..
Event Sequences, Recurrent Neural Networks, PyBrain http://stackoverflow.com/questions/12689293/event-sequences-recurrent-neural-networks-pybrain hiddenclass LSTMLayer outclass SigmoidLayer recurrent True ds SequentialDataSet INPUTS OUTPUTS for x y in itertools.izip datain.. INPUTS OUTPUTS for x y in itertools.izip datain dataout ds.newSequence ds.appendLinked tuple x tuple y net.randomize trainer.. for x y in itertools.izip datain dataout ds.newSequence ds.appendLinked tuple x tuple y net.randomize trainer BackpropTrainer..
Can you loop through pixels in an image without loading the whole image? http://stackoverflow.com/questions/14911590/can-you-loop-through-pixels-in-an-image-without-loading-the-whole-image show how to load a PNG row by row import gdal # only loads the dataset ds gdal.Open 'D my_large_image.png' # read 1 row.. load a PNG row by row import gdal # only loads the dataset ds gdal.Open 'D my_large_image.png' # read 1 row at the time for.. # read 1 row at the time for row in range ds.RasterYSize row_data ds.ReadAsArray 0 row ds.RasterXSize 1 ds..
Speeding up a closest point on a hyperbolic paraboloid algorithm http://stackoverflow.com/questions/18858448/speeding-up-a-closest-point-on-a-hyperbolic-paraboloid-algorithm paraboloid algorithm I wrote a python script which finds the UV coords of the closest point on surface from a query point.. algorithm I wrote a python script which finds the UV coords of the closest point on surface from a query point p . The surface.. problem with my approach is that it is very slow ~10 seconds to do 5000 queries with a low precision threshold. I'm looking..
How to compare datetime in Django? http://stackoverflow.com/questions/1887354/how-to-compare-datetime-in-django to compare datetime in Django Suppose I have ds datetime.datetime.now dd Entry.objects.get pk id .pub_date How.. simply a date rather than a datetime you may as well use ds datetime.date.today instead ds datetime.date.today dd datetime.date.. you may as well use ds datetime.date.today instead ds datetime.date.today dd datetime.date 2009 12 9 ds dd datetime.timedelta..
Machine Learning Algorithm for Predicting Order of Events? http://stackoverflow.com/questions/2524608/machine-learning-algorithm-for-predicting-order-of-events hiddenclass LSTMLayer outclass SigmoidLayer recurrent True ds SequentialDataSet INPUTS OUTPUTS # your_sequences is a list.. your_sequences for inpt target in zip sequence sequence 1 ds.newSequence ds.appendLinked inpt target net.randomize trainer.. for inpt target in zip sequence sequence 1 ds.newSequence ds.appendLinked inpt target net.randomize trainer BackpropTrainer..
Matplotlib: simultaneous plotting in multiple threads http://stackoverflow.com/questions/4659680/matplotlib-simultaneous-plotting-in-multiple-threads simultaneous plotting in multiple threads I am trying to do some plotting in parallel to finish large.. and close itself as I understand it Python closes threads when they get through all the statements in run . Below is some.. 1 time.sleep 1 print 'waiting on d threads n' threading.activeCount 1 print ' ds elapsed' time.time start..
Python: pretty-printing ascii tables? http://stackoverflow.com/questions/5909873/python-pretty-printing-ascii-tables def pprinttable rows if len rows 1 headers rows 0 ._fields lens for i in range len rows 0 lens.append len max x i for x.. rows 0 i int formats.append dd lens i else formats.append ds lens i hformats.append ds lens i pattern .join formats hpattern.. dd lens i else formats.append ds lens i hformats.append ds lens i pattern .join formats hpattern .join hformats separator..
How to merge multiple dicts with same key? http://stackoverflow.com/questions/5946236/how-to-merge-multiple-dicts-with-same-key assuming all keys are always present in all dicts ds d1 d2 d for k in d1.iterkeys d k tuple d k for d in ds share..
How can I create two unique, queriable fields for a GAE Datastore Data Model? http://stackoverflow.com/questions/6584435/how-can-i-create-two-unique-queriable-fields-for-a-gae-datastore-data-model can I create two unique queriable fields for a GAE Datastore Data Model First a little setup. Last week.. constructed which would allow me to manage two unique fields associated with one db.Model object. Since this isn't possible.. would not solve my problem of needing two unique fields associated with one db.Model object. My implementation tried..
Playing a sound from a wave form stored in an array http://stackoverflow.com/questions/8707967/playing-a-sound-from-a-wave-form-stored-in-an-array an array I'm currently experimenting with generating sounds in Python and I'm curious how I can take a n array representing.. Writing it all in pure python could be many thousands of lines of code to interface with the audio hardware With a.. e.g. audiere it will be as simple as this import audiere ds audiere.open_device os ds.open_array input_array 44100 os.play..
|