I ran the following script (https://github.com/FXCMAPI/FXCMTickData/blob/master/TickData34.py) and added the following lines at the end to download the files:
output_folder = '/Users/me/Documents/data/forex/'
target_folder = os.path.join(output_folder, symbol, year)
os.makedirs(target_folder, exist_ok=True)
with open(os.path.join(target_folder, str(i) + '.csv'), 'wb') as outfile:
outfile.write(data)
Then, I tried opening the file using pandas as follows:
x = pd.read_csv('/Users/me/Documents/data/forex/EURUSD/2015/29.csv')
However, this is what I got:
In [3]: x.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 2415632 entries, 0 to 2415631
Data columns (total 3 columns):
D float64
Unnamed: 1 float64
Unnamed: 2 float64
dtypes: float64(3)
memory usage: 55.3 MB
In [4]: x.dropna()
Out[4]:
Empty DataFrame
Columns: [D, Unnamed: 1, Unnamed: 2]
Index: []
Why is the dataframe empty?
If I open the file on TextEdit, the first few lines actually look like this:
DateTime,Bid,Ask
07/19/2015 21:00:15.469,1.083,1.08332
07/19/2015 21:00:16.949,1.08311,1.08332
07/19/2015 21:00:16.955,1.08311,1.08338