Python for Finance: Analyze Big Financial Data
Fast I/O with PyTables PyTables is a Python binding for the HDF5 database/file standard (cf. http://www.hdfg ...
In [ 105 ]: %%time for i in range(rows): pointer[‘Date’] = dt.datetime.now() pointer[‘No1’] = ran_int[i, 0 ] pointer[ ...
“No3”: Float64Col(shape=(), dflt=0.0, pos=3), ...
print len(tab[:][‘No3’]) Out[118]: 2000000 CPU times: user 396 ms, sys: 89 ms, ...
print “Max %18.3f” % values.max() print “Ave %18.3f” % values.mean() print “Min %18.3f” % values.min() print “Std %18. ...
This indeed takes much longer than before. However, the compression ratio is about 20%, saving 80% of the s ...
PyTables supports out-of-memory operations, which makes it possible to implement array-based computations ...
/out (EArray(750000, 1000)) ” atom ...
Conclusions SQL-based (i.e., relational) databases have advantages when it comes to complex data structures that ...
Further Reading The paper cited at the beginning of the chapter as well as in the “Conclusions” section is a ...
Chapter 8. Performance Python Don’t lower your expectations to meet your performance. Raise your leve ...
Python Paradigms and Performance In finance, like in other scientific and data-intensive disciplines, numerical ...
In [ 11 ]: def f5(a): ex = ‘abs(cos(a)) ** 0.5 + sin(2 + 3 * a)’ ne.set_num_threads( 1 ) return ne.evaluate(ex ...
There is a clear winner: the multithreaded numexpr implementation f6. Its speed advantage, of course, depends on the ...
Memory Layout and Performance NumPy allows the specification of a so-called dtype per ndarray object: for example, ...
One gets similar results for calculating standard deviations: In [ 28 ]: %timeit C.std(axis= 0 ) Out[28]: 10 loops ...
Parallel Computing Nowadays, even the most compact notebooks have mainboards with processors that have mu ...
dt = T / M rand = np.random.standard_normal((M + 1 , I)) S = np.zeros((M + 1 , I)); S[ 0 ] = ...
Notebook dashboard. The number of threads to be used of course depends on the machine and the processor you ar ...
number of option valuations/strikes ...
«
5
6
7
8
9
10
11
12
13
14
»
Free download pdf