Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
cs.collections error
#1
Hi
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()
Reply


Messages In This Thread
cs.collections error - by DaveG - Apr-06-2022, 05:27 AM
RE: cs.collections error - by ndc85430 - Apr-06-2022, 06:24 AM
RE: cs.collections error - by DaveG - Apr-06-2022, 06:33 AM
RE: cs.collections error - by ndc85430 - Apr-06-2022, 06:39 AM
RE: cs.collections error - by Larz60+ - Apr-06-2022, 07:01 AM
RE: cs.collections error - by DaveG - Apr-06-2022, 08:52 AM
RE: cs.collections error - by DaveG - Apr-06-2022, 09:02 AM
RE: cs.collections error - by Larz60+ - Apr-06-2022, 04:18 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Trying to understand how isinstance(values, collections.Iterable) work. quazirfan 7 4,267 Aug-10-2021, 08:10 AM
Last Post: snippsat
  AttributeError: 'collections.OrderedDict' object has no attribute 'value_counts Kristenl2784 4 7,415 Jul-17-2020, 01:50 AM
Last Post: palladium
  collections.OrderedDict Bert123456 2 1,816 Jul-09-2020, 08:51 PM
Last Post: Bert123456
  AttributeError: module 'collections' has no attribute 'namedtuple' epgs1975 2 10,382 May-04-2020, 08:10 PM
Last Post: epgs1975
  Problem with importing and using collections module pythomdummy 3 5,897 Nov-14-2019, 08:48 AM
Last Post: Gribouillis
  Please, advise collections for my task AlekseyPython 1 2,141 Sep-11-2019, 12:44 PM
Last Post: perfringo
  What's the use case of collections.counter? magic 2 2,632 Sep-21-2018, 02:04 AM
Last Post: Mekire
  Drills/Exercises for collections, itertools, and common built-in data structures? Cranberry 2 3,405 Apr-26-2018, 05:43 PM
Last Post: Cranberry

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020