The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
"Importing a time series from CSV - lots of funky problems"
Importing a time series from CSV - lots of funky problems
I have a moderately large foreign exchange time series .csv file that I am trying to import. I had gotten frustrated trying to do this in RM 5.0 beta, but I decided to give it another try, updated to 5.1 with the time series extension and used the old repository. This is a EURUSD file with 1 minute data going back about 10 years (over 3.4 million records, 135MB with 7 fields in the standard format: date, time, open, high, low, close and volume). The date and time were nominal type. I tried to pre-process the data, converting the first two columns to date and time type. RM for some reason decided it needed over 10x the actual file size in RAM, hung, crashed, and so forth. (How are people with big time series such as hours of 96kHz vibration data expected to use this? In my admittedly slight experience R is a lot better with memory and orders of magnitude faster.) So I tried using a "cut last" as the first step (100000) and it gave me an error about the simple example set format being incompatible with time series (even with breakpoint on the cut last function), and a "WARNING: Using deprecated example set stream version 1"
So I decided to re-import using the wizard, though I couldn't see why or even how the file formats could affect such a simple case.
The .csv import does not seem to work properly. The default seems to be semicolon separators, which is a strange choice for a comma delimited format, but that's no big deal. Trying to get the date to import as a date in format "yyyy.MM.dd", it turns dates into date-times, all with 00:00:00 EDT. One can only set one format, so there is no way to specify the time column's format once the date format is set. . If the time format is specified instead (first setting date back to nominal), the times are all also converted to date-times, with a "Thu Jan 01 HH:mm:ss EST 1970" format, when HH:mm is specified as the Date format. There seems to be no capability to combine the date and time into one temporal index, at least without using a different program to preprocess the data. After trying out a few type options, all the data disappears from the wizard preview and one must start over. (I can't seem to get it to do it a fourth time. This program is clearly trying to drive me insane. AHA - it happens after trying to reload the data after an error, described below.)
The initial guess is that the date column is polynominal and the time is binominal. With the 100 record preview, that works (though it's certainly strange that a program such as this can't guess date and time formats), but loading more data throws an error - apparently 01:04 occurs more than once in the column, so it just displays all "?" for that column. Now why having the same value twice should be a problem, I don't know, nor why it hit on 01:04 as an example when 01:02 is the first repeat, but the next reload (more than 100 rows) causes all the preview data to disappear. ???
Added:
(The forum software has some issues, too - I push prieview, my login was timed out. It tried to eat my post, but I re-login, go back, there's my text. Now it will preview, but not post, and doesn't prompt for a login. Copy all, go back, restart topic from scratch... sigh. Edit: and now I find it did post the first time, but just wouldn't admit it. And I can't delete it despite there being a button supposedly for that purpose. Double sigh.)
I have a moderately large foreign exchange time series .csv file that I am trying to import. I had gotten frustrated trying to do this in RM 5.0 beta, but I decided to give it another try, updated to 5.1 with the time series extension and used the old repository. This is a EURUSD file with 1 minute data going back about 10 years (over 3.4 million records, 135MB with 7 fields in the standard format: date, time, open, high, low, close and volume). The date and time were nominal type. I tried to pre-process the data, converting the first two columns to date and time type. RM for some reason decided it needed over 10x the actual file size in RAM, hung, crashed, and so forth. (How are people with big time series such as hours of 96kHz vibration data expected to use this? In my admittedly slight experience R is a lot better with memory and orders of magnitude faster.) So I tried using a "cut last" as the first step (100000) and it gave me an error about the simple example set format being incompatible with time series (even with breakpoint on the cut last function), and a "WARNING: Using deprecated example set stream version 1"
So I decided to re-import using the wizard, though I couldn't see why or even how the file formats could affect such a simple case.
The .csv import does not seem to work properly. The default seems to be semicolon separators, which is a strange choice for a comma delimited format, but that's no big deal. Trying to get the date to import as a date in format "yyyy.MM.dd", it turns dates into date-times, all with 00:00:00 EDT. One can only set one format, so there is no way to specify the time column's format once the date format is set. . If the time format is specified instead (first setting date back to nominal), the times are all also converted to date-times, with a "Thu Jan 01 HH:mm:ss EST 1970" format, when HH:mm is specified as the Date format. There seems to be no capability to combine the date and time into one temporal index, at least without using a different program to preprocess the data. After trying out a few type options, all the data disappears from the wizard preview and one must start over. (I can't seem to get it to do it a fourth time. This program is clearly trying to drive me insane. AHA - it happens after trying to reload the data after an error, described below.)
The initial guess is that the date column is polynominal and the time is binominal. With the 100 record preview, that works (though it's certainly strange that a program such as this can't guess date and time formats), but loading more data throws an error - apparently 01:04 occurs more than once in the column, so it just displays all "?" for that column. Now why having the same value twice should be a problem, I don't know, nor why it hit on 01:04 as an example when 01:02 is the first repeat, but the next reload (more than 100 rows) causes all the preview data to disappear. ???
Added:
(The forum software has some issues, too - I push prieview, my login was timed out. It tried to eat my post, but I re-login, go back, there's my text. Now it will preview, but not post, and doesn't prompt for a login. Copy all, go back, restart topic from scratch... sigh. Edit: and now I find it did post the first time, but just wouldn't admit it. And I can't delete it despite there being a button supposedly for that purpose. Double sigh.)
Tagged:
0
Answers
Importing can indeed sometimes be "fun". Could you post a sufficiently large snapshot of the data that exhibits the problem as well as the XML of your process? I can't promise success but I might be able to make a suggestion or two.
regards
Andrew
I managed to load 10GB (and larger) time series datasets in Rapd Miner.
Here is a tip that may help you:
Find your data attribute in "Read CSV" > 'data set meta data information'
Change the type to "date_time", not "date".
Best regards,
Wessel
Andrew:
The problem with the import process using the old data already in a repository was I think mostly due to the large file, and I have been trying other things with the import process so that original XML is gone, anyway.
The .csv wizard import problem happens with a smaller set and isn't dependent on any xml, so I have attached the first 4096 records from the csv file. The time format has changed due to using OpenOffice Calc to trim the file down. See data below.
Steps to reproduce:
Try to import EURUSD1a.csv with the wizard.
2nd screen - Column separator = comma
uncheck "ignore errors"
skip 3rd screen (annotation)
4th screen:
date format = "yyy.MM.dd"
set 1st column to date type
reload data
set 2nd column to time type
reload data
all data has disappeared. The wizard must be restarted. If you continue to try to export without restarting, the repository file will only be a few hundred bytes with no real data.
2nd problem:
restart the wizard
perform the same steps until you get to the fourth screen of the wizard.
uncheck "Preview uses only first 100 rows"
uncheck "ignore errors"
Reload data
(close error popup)
reload data again
All data has disappeared.
***
As far as my plan, If I can't make Wessel's suggestion work for me, I plan to use OpenOffice Calc to split the file up into 65536 record chunks, change the file extensions to .txt, use the regexp search and replace in OO Writer to merge the date and time fields, rename to *.csv, then import the files individually (over 2 months of data in a file isn't too bad, and they'll load at least 50x faster.)
***
Well, I don't see an option to attach files. [glow=red,2,300]Glow[/glow] and [move]scrolling marquees[/move] insert Flash, lots of animated emoticons ::) ... if I had a server, I suppose the www or ftp links would work, but it sure seems like a fundamental oversight not to provide any way to attach a file. Maybe I'm missing something.
These edited lines should reproduce the problem:
To save you doing the conversion in OpenOffice you could do it like this.
I've added more operators than is probably necessary, but hey I like to complicate things. ;D
Andrew