Apr-06-2022, 05:27 AM
Hi
I have this error from the python 2.7 code below. Can someone help please? Much appreciated.
I have this error from the python 2.7 code below. Can someone help please? Much appreciated.
Error:Traceback (most recent call last):
File "C:/Users/David/PycharmProjects/pythonProject2/venv/init_collapse.py", line 107, in <module>
csp=cs.collections[0].get_paths()[2]# path
IndexError: list index out of range
################################################## collapse bathymetry data collapse_steps=2 # can be changed by USER collapse_starttime=0.0 # in second; can be changed by USER collapse_times=linspace(0,collapse_duration,collapse_steps) cs=contour(kxx,kyy,-kelevation,[collapse_depth]) csp=cs.collections[0].get_paths()[2]# path csv=csp.vertices # vertices csv_x=csv[:,0] csv_y=csv[:,1] if (not plot_debugfig): close()