Changeset 5586 for anuga_core/source/anuga/shallow_water/data_manager.py
- Timestamp:
- Jul 30, 2008, 4:59:59 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/data_manager.py
r5582 r5586 953 953 954 954 955 def csv2array(file_name): 956 """Convert CSV files of the form 957 958 time, discharge, velocity 959 0.0, 1.2, 0.0 960 0.1, 3.2, 1.1 961 ... 962 963 to a dictionary of numeric arrays. 964 965 966 See underlying function csv2dict for more details. 967 968 """ 969 970 971 X, _ = csv2dict(file_name) 972 973 Y = {} 974 for key in X.keys(): 975 Y[key] = array([float(x) for x in X[key]]) 976 977 return Y 978 979 955 980 def csv2dict(file_name, title_check_list=None): 956 981 """ … … 961 986 Two dictionaries are returned. 962 987 963 WARNING: Va ules are returned as strings.988 WARNING: Values are returned as strings. 964 989 do this to change a list of strings to a list of floats 965 990 time = [float(x) for x in time]
Note: See TracChangeset
for help on using the changeset viewer.