Python for Finance: Analyze Big Financial Data
High-Frequency Data By now, you should have a feeling for the strengths of pandas when it comes to financia ...
Figure 6-11. Apple stock tick data for a week Figure 6-12. Apple stock tick data and volume for ...
Figure 6-13. Resampled Apple stock tick data To conclude this section, we apply a custom-defined Py ...
Conclusions Financial time series data is one of the most common and important forms of data in finance. ...
Further Reading At the time of this writing, the definitive resource in printed form for pandas is the book ...
Chapter 7. Input/Output Operations It is a capital mistake to theorize before one has data. — Sherlock Holme ...
I/O with PyTables PyTables uses the HDF5 standard to accomplish fast I/O operations for large data s ...
Basic I/O with Python Python itself comes with a multitude of I/O capabilites, some optimized for perfor ...
2.5483218463404067, 0.9822259685028746, 3.594915396586916] To ensure that objects a and b are indeed the same, NumPy ...
beforehand what is stored in a pickle file. A sometimes helpful workaround is to not store single objects, ...
The actual data is then written row by row, merging the date-time information with the (pseudo)random number ...
In [ 45 ]: import datetime as dt A single data row can be written with the respective SQL statement, as follows: In ...
In [ 54 ]: dtimes = np.arange(‘2015-01-01 10:00:00’, ‘2021-12-31 22:00:00’, dtype=‘datetime64[m]’) # minute inter ...
Out[64]: CPU times: user 2 ms, sys: 216 ms, total: 218 ms Wall time: 216 m ...
I/O with pandas One of the major strengths of the pandas library is that it can read and write different ...
Our test case will again be a large set of floating-point numbers: In [ 66 ]: import numpy as np import pa ...
Figure 7-1. Plot of the query result From SQL to pandas A generally more efficient approach, however, ...
In [ 81 ]: %%time res = data[[‘No1’, ‘No2’]][((data[‘No1’] > 0.5) | (data[‘No1’] < -0.5)) ...
As a summary, we can state the following with regard to our dummy data set, which is roughly 50 MB ...
This illustrates what kind of overhead the spreadsheet structure brings along with it. Reading (and pl ...
«
4
5
6
7
8
9
10
11
12
13
»
Free download pdf