def crop(self, start_timestamp, end_timestamp):
output = {}<EOL>for key, value in self.items():<EOL><INDENT>if key >= start_timestamp and key <= end_timestamp:<EOL><INDENT>output[key] = value<EOL><DEDENT><DEDENT>if output:<EOL><INDENT>return TimeSeries(output)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>
Return a new TimeSeries object contains all the timstamps and values within
the specified range.

:param int start_timestamp: the start timestamp value
:param int end_timestamp: the end timestamp value
:return: :class:`TimeSeries` object.