Python Forum
First for loop stops after first iteration
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
First for loop stops after first iteration
#3
(Apr-30-2019, 12:42 PM)buran Wrote: break
without the break statement the output is the following one
Output:
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-170-4c6aef3bebbf> in <module> 16 return new1.reshape( shape ) 17 ---> 18 print (get_matrix(f1, f2)) <ipython-input-170-4c6aef3bebbf> in get_matrix(f1, f2) 13 new1 = np.array(new) 14 shape = ( 30, 20 ) ---> 15 new1.reshape( shape ) 16 return new1.reshape( shape ) 17 ValueError: cannot reshape array of size 3200 into shape (30,20)
Reply


Messages In This Thread
RE: First for loop stops after first iteration - by Divanova94 - Apr-30-2019, 12:47 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  pip stops waiting for python walker 6 1,068 Nov-28-2023, 06:55 PM
Last Post: walker
  Inconsistent loop iteration behavior JonWayn 2 1,007 Dec-10-2022, 06:49 AM
Last Post: JonWayn
  [SOLVED] [Linux] Script in cron stops after first run in loop Winfried 2 937 Nov-16-2022, 07:58 PM
Last Post: Winfried
  Know when the pyttsx3 engine stops talking UsualCoder 3 3,243 Aug-29-2021, 11:08 PM
Last Post: snippsat
  saving each iteration of a loop sgcgrif3 3 6,748 Jul-27-2021, 01:02 PM
Last Post: DeaD_EyE
  IDLE stops responding upon saving tompi1 2 1,947 Oct-01-2020, 05:44 PM
Last Post: Larz60+
  String slicing and loop iteration divyansh 9 4,773 Jun-07-2020, 10:29 PM
Last Post: divyansh
  Python timer script stops before should ozstar 3 2,240 May-04-2020, 12:55 AM
Last Post: ozstar
  Python stops without errors shahgourav 4 2,784 Feb-04-2020, 11:44 PM
Last Post: micseydel
  Changing a variable's name on each iteration of a loop rix 6 84,846 Jan-03-2020, 07:06 AM
Last Post: perfringo

Forum Jump:

User Panel Messages

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