¡@

Home 

python Programming Glossary: t1

timeit versus timing decorator

http://stackoverflow.com/questions/1622943/timeit-versus-timing-decorator

kw '''source http www.daniweb.com code snippet368.html''' t1 time.time res func arg kw t2 time.time return t2 t1 res func.func_name.. t1 time.time res func arg kw t2 time.time return t2 t1 res func.func_name return wrapper @timing_val def time_izip..

String concatenation vs. string substitution in Python

http://stackoverflow.com/questions/376461/string-concatenation-vs-string-substitution-in-python

... so_q_cat 1000 'http stackoverflow.com questions 1000' t1 timeit.Timer 'so_q_sub 1000 ' 'from __main__ import so_q_sub'.. 'so_q_cat 1000 ' 'from __main__ import so_q_cat' t1.timeit number 10000000 12.166618871951641 t2.timeit number 10000000.. t2.timeit number 10000000 5.7813972166853773 t1.timeit number 1 1.103492206766532e 05 t2.timeit number 1 8.5206360154188587e..

python equivalent of filter() getting two output lists (i.e. partition of a list)

http://stackoverflow.com/questions/4578590/python-equivalent-of-filter-getting-two-output-lists-i-e-partition-of-a-list

# partition is_odd range 10 0 2 4 6 8 and 1 3 5 7 9 t1 t2 tee iterable return filterfalse pred t1 filter pred t2 The.. 8 and 1 3 5 7 9 t1 t2 tee iterable return filterfalse pred t1 filter pred t2 The recipe comes from the Python 3.x documentation...

Pairs from single list

http://stackoverflow.com/questions/4628290/pairs-from-single-list

# time the pairing s time.time for i in range 1000 p f A t1 time.time s # time using the pairs s time.time for i in range.. in range 1000 p f A for a b in p pass t2 time.time s print t1 t2 t2 t1 These were the results on my computer 1.48668909073.. 1000 p f A for a b in p pass t2 time.time s print t1 t2 t2 t1 These were the results on my computer 1.48668909073 2.63187503815..

NumPy: calculate averages with NaNs removed

http://stackoverflow.com/questions/5480694/numpy-calculate-averages-with-nans-removed

np.isnan dat mm np.mean mdat axis 1 mm.filled np.nan N 2 t1 Timer method1 setupstr .timeit N t2 Timer np.mean l for l in.. dat axis 1 setupstr .timeit N print 'Time f tRatio f' t1 t1 t1 print 'Time f tRatio f' t2 t2 t1 print 'Time f tRatio.. dat axis 1 setupstr .timeit N print 'Time f tRatio f' t1 t1 t1 print 'Time f tRatio f' t2 t2 t1 print 'Time f tRatio f'..

Algorithm to Divide a list of numbers into 2 equal sum lists

http://stackoverflow.com/questions/890171/algorithm-to-divide-a-list-of-numbers-into-2-equal-sum-lists

def make_teams que que.sort if len que 2 que.insert 0 0 t1 t2 while que val que.pop que.pop if sum t1 sum t2 t2.append.. que.insert 0 0 t1 t2 while que val que.pop que.pop if sum t1 sum t2 t2.append val 0 t1.append val 1 else t1.append val 0.. que val que.pop que.pop if sum t1 sum t2 t2.append val 0 t1.append val 1 else t1.append val 0 t2.append val 1 print min..

ReportLabs Django Integration

http://stackoverflow.com/questions/20213339/reportlabs-django-integration

Exception Value Can't setFont Times Roman missing the T1 files Originally type 'exceptions.TypeError' makeT1Font argument.. the T1 files Originally type 'exceptions.TypeError' makeT1Font argument 2 must be string not None Where I'm going wrong..

INSERT not working in cx_oracle when used with execute. How to get it working?

http://stackoverflow.com/questions/5642708/insert-not-working-in-cx-oracle-when-used-with-execute-how-to-get-it-working

using sqlplus from shell . The code I used was table_name T1 column D insert_value test value sqlcode INSERT INTO table_name..

How can I use C++ class in Python?

http://stackoverflow.com/questions/602580/how-can-i-use-c-class-in-python

void setInt int k n k int getInt return n Now in Python T1 Test 12 T1.getInt 12 T1.setInt 32 T1.getInt 32 Please suggest.How.. int k n k int getInt return n Now in Python T1 Test 12 T1.getInt 12 T1.setInt 32 T1.getInt 32 Please suggest.How can I.. getInt return n Now in Python T1 Test 12 T1.getInt 12 T1.setInt 32 T1.getInt 32 Please suggest.How can I do this NOTE..

How to convert strings into integers in python?

http://stackoverflow.com/questions/642154/how-to-convert-strings-into-integers-in-python

I have a tuple of tuples from MySQL query like this T1 '13' '17' '18' '21' '32' '07' '11' '13' '14' '28' '01' '05'..

python factory functions compared to class

http://stackoverflow.com/questions/901892/python-factory-functions-compared-to-class

there is a speed advantage to the nested functions as well T1 timeit.Timer 'maker 3 4 ' 'from __main__ import maker' T1.timeit.. T1 timeit.Timer 'maker 3 4 ' 'from __main__ import maker' T1.timeit 1.2818338871002197 T2 timeit.Timer 'clsmaker 3 4 ' 'from..

IronPython integration with C#/ .NET

http://stackoverflow.com/questions/9053268/ironpython-integration-with-c-net

CallSite site CodeContext context TFuncType func T0 arg0 T1 arg1 T2 arg2 T3 arg3 at System.Dynamic.UpdateDelegates.UpdateAndExecute6.. at System.Dynamic.UpdateDelegates.UpdateAndExecute6 T0 T1 T2 T3 T4 T5 TRet CallSite site T0 arg0 T1 arg1 T2 arg2 T3 arg3.. T0 T1 T2 T3 T4 T5 TRet CallSite site T0 arg0 T1 arg1 T2 arg2 T3 arg3 T4 arg4 T5 arg5 at IronPython.Runtime.Importer.Import..

Use blocks from included files for parent in jinja2

http://stackoverflow.com/questions/9624953/use-blocks-from-included-files-for-parent-in-jinja2

of including it you import the macros with context. File T1 root block t3_container block t3 endblock block t3_container..