Now can get and set name in Dataset. Also added getter for dim_names.
This commit is contained in:
		| @@ -10,7 +10,8 @@ class Dataset: | ||||
|     A Dataset is an n-way array with defined string identifiers across | ||||
|     all dimensions. | ||||
|     """ | ||||
|     def __init__(self,input_array,def_list): | ||||
|     def __init__(self, input_array, def_list, name="Unnamed data"): | ||||
|         self._name = name | ||||
|         self._data = asarray(input_array) | ||||
|         dims = shape(self._data) | ||||
|         self.def_list = def_list | ||||
| @@ -43,9 +44,11 @@ class Dataset: | ||||
|             if len(df)!=d and df: | ||||
|                 raise ValueError,"dim size and identifyer mismatch" | ||||
|              | ||||
|     def __str__(self): | ||||
|         self.name = 'Arnar' | ||||
|         return self.name | ||||
|     def get_name(self): | ||||
|         return self._name | ||||
|  | ||||
|     def get_dim_names(self): | ||||
|         return self._dim_names | ||||
|      | ||||
|     def names(self,axis=0): | ||||
|         """Returns identifier names of a dimension. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user