This is a two-part question, with an immediate question and a more general one.
I have a pandas TimeSeries, ts. To know the first value after a certain time. I can do this,
ts.ix[ts[datetime(2012,1,1,15,0,0):].first_valid_index()]
a) Is there a better, less clunky way to do it?
b) Coming from C, I have a certain phobia when dealing with these somewhat opaque, possibly mutable but generally not, possibly lazy but not always types. So to be clear, when I do
ts[datetime(2012,1,1,15,0,0):].first_valid_index()
ts[datetime(2012,1,1,15,0,0):] is a pandas.TimeSeries object right? And I could possibly mutate it.
Does it mean that whenever I take a slice, there's a copy of ts being allocated in memory? Does it mean that this innocuous line of code could actually trigger the copy of a gigabyte of TimeSeries just to get an index value?
Or perhaps they magically share memory and a lazy copy is done if one of the object is mutated for instance? But then, how do you know which specific operations trigger a copy? Maybe not slicing but how about renaming columns? It doesn't seem to say so in the documentation. Does that bother you? Should it bother me or should I just learn not to worry and catch problems with a profiler?