changeset 154:f8a1ae7eb83e

merge
author Frederic Bastien <bastienf@iro.umontreal.ca>
date Mon, 12 May 2008 16:13:48 -0400
parents 71107b0ac860 (diff) 3f627e844cba (current diff)
children cc8b032417db e8c8022582f4
files dataset.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dataset.py	Mon May 12 16:11:24 2008 -0400
+++ b/dataset.py	Mon May 12 16:13:48 2008 -0400
@@ -1084,6 +1084,11 @@
               return Example(fieldnames,[all_fields_minibatch[name] for name in fieldnames])
       return CacheIterator(self)
 
+  def __getitem__(self,i):
+      if type(i)==int and len(self.cached_examples)>i:
+          return self.cached_examples[i]
+      else:
+          return DataSet.__getitem__(self,i)
                       
 class ApplyFunctionDataSet(DataSet):
   """