Skip to main content
Became Hot Network Question
added 2 characters in body
Source Link
Jagra
  • 14.6k
  • 1
  • 39
  • 82

I have a number of long lists of DateObjects paired with values. An example data element looks like this:

enter image description here

It takes several hours of processing time to generate these lists and as I can reuse them, I want to save them so I can Import them as needed rather than recalculating them.

I tried exporting the data lists:

Export[".../Index model/sp.CSV", sp,"CSV"];

Upon then:

Import[".../Index model/sp.CSV","CSV"]

I get elements that look like the following:

{"DateObject[{1977, 2, 15, 0, 0, 0.}, \"Instant\", \"Gregorian\", \
-5.]", 101.04}

Which does not give me an immediately computable DateObject.

I appreciate that I can derive a DateObject from this imported data, but that defeats some of the purpose in exporting the data in the first place.

Does someway exist so I can Export DateObjects that stay DateObjects on ImportImport?

I have a number of long lists of DateObjects paired with values. An example data element looks like this:

enter image description here

It takes several hours of processing time to generate these lists and as I can reuse them, I want to save them so I can Import them as needed rather than recalculating them.

I tried exporting the data lists:

Export[".../Index model/sp.CSV", sp,"CSV"];

Upon then:

Import[".../Index model/sp.CSV","CSV"]

I get elements that look like the following:

{"DateObject[{1977, 2, 15, 0, 0, 0.}, \"Instant\", \"Gregorian\", \
-5.]", 101.04}

Which does not give me an immediately computable DateObject.

I appreciate that I can derive a DateObject from this imported data, but that defeats some of the purpose in exporting the data in the first place.

Does someway exist so I can Export DateObjects that stay DateObjects on Import?

I have a number of long lists of DateObjects paired with values. An example data element looks like this:

enter image description here

It takes several hours of processing time to generate these lists and as I can reuse them, I want to save them so I can Import them as needed rather than recalculating them.

I tried exporting the data lists:

Export[".../Index model/sp.CSV", sp,"CSV"];

Upon then:

Import[".../Index model/sp.CSV","CSV"]

I get elements that look like the following:

{"DateObject[{1977, 2, 15, 0, 0, 0.}, \"Instant\", \"Gregorian\", \
-5.]", 101.04}

Which does not give me an immediately computable DateObject.

I appreciate that I can derive a DateObject from this imported data, but that defeats some of the purpose in exporting the data in the first place.

Does someway exist so I can Export DateObjects that stay DateObjects on Import?

Source Link
Jagra
  • 14.6k
  • 1
  • 39
  • 82

Export and Import DateObjects

I have a number of long lists of DateObjects paired with values. An example data element looks like this:

enter image description here

It takes several hours of processing time to generate these lists and as I can reuse them, I want to save them so I can Import them as needed rather than recalculating them.

I tried exporting the data lists:

Export[".../Index model/sp.CSV", sp,"CSV"];

Upon then:

Import[".../Index model/sp.CSV","CSV"]

I get elements that look like the following:

{"DateObject[{1977, 2, 15, 0, 0, 0.}, \"Instant\", \"Gregorian\", \
-5.]", 101.04}

Which does not give me an immediately computable DateObject.

I appreciate that I can derive a DateObject from this imported data, but that defeats some of the purpose in exporting the data in the first place.

Does someway exist so I can Export DateObjects that stay DateObjects on Import?