@stepan-a the idea was to provide similar functionality between dates and dseries
Empty dseries are useful for concatenating dseries in a loop or, as you do with dates initializing some member of the dseries then using that to initialize new dseries
@houtanb I understand that empty objects are useful for concatenation and initialization of loops, but I do not get what we can do with an empty dseriesobject having an initial date or a range of dates. In your example we would want to create a new dseries object with default initial date (1) and default name for the variable ('''Variable_1''')... This is not very useful. If we do (as we would with dates):
data=dseries(dates('1950Q1'))
and
a=data(rand(3,1))
we would create a new object with 1950Q1 as the initial date. But if we do:
a=data('mygdpdata.csv')
and if the first column of the CSV file has dates, how do we define the initial date then ? Also having an initial date or a range of dates in an empty dseriesobject is not useless for concatenation and loops.
I am not convinced by the idea of having similar behavior between dates and dserieson this matter, because I do not see any practical advantage... So I wonder if we should not remove the possibility of empty dseriesobjects with dates.
@stepan-a it's precisely useful for when you want a different default for a new dseries and it's useful for concatenating in loops. Aren't those reason enough?
In the example above, I like the idea that if the csv file has dates in it, the date in data would take precedence. Otherwise, the person should just use dseries.
In the end, however, I created this ticket when creating the slides for the summer school and I noted that you had created this functionality but that it didn't work. In the end, the decision is to either remove it or add this functionality. I would push to add because concatenation of dseries in loops is useful as is initialing dseries with a different default date.
if you concatenate the empty object data, defined in my previous comment, with say a=dseries(rand(3,1),'1950Q1'), you loose the information about the initial date in data. So I do not see how this could be useful. I just proposed to remove empty dseriesobjects with dates, not all the empty dseriesobjects.
I understand your idea now... This would just be a way to change the default initial date (which is 1). But
In this case we do not need to consider range of dates in empty objects (because there is no default for the ranges),
The initial date defined in the csv file should prevail (this is how it works with the default initial date),
I think the initial date in the csv should prevail if using dseries. The idea of having an empty dseries object with a different inital date would be to allow the user to easily change the default initial date of any dseries created with this object, either in the code or via a .csv.