Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Where's the endless loop?
#7
I'll have to study both of your responses closely and better understand exactly how they work.

I guess part of me has been thinking the plots accumulate points until they are to be shown at which time all collected points are included. I tried this:

fig=plt.figure()
fig, ax = plt.subplots(2,2)

df = pd.read_csv("C:/Users/Mark/Desktop/SPX_2021_copy.csv")

my_dict = dict(df['DTE'].value_counts())

#for num,key in enumerate(my_dict):
for key in my_dict:
    if key < 251:
        ax[0,0].plot(key,my_dict[key])
    elif (key > 250 and key < 501):
        ax[0,1].plot(key,my_dict[key])
    elif (key > 500 and key < 751):
        ax[1,0].plot(key,my_dict[key])
    elif key > 750:
        ax[1,1].plot(key,my_dict[key])
This output the axes with correct label ranges, but blank graphs themselves with no data plotted.
Reply


Messages In This Thread
Where's the endless loop? - by Mark17 - Oct-01-2021, 02:08 PM
RE: Where's the endless loop? - by Mark17 - Oct-01-2021, 02:41 PM
RE: Where's the endless loop? - by Mark17 - Oct-01-2021, 03:02 PM
RE: Where's the endless loop? - by Mark17 - Oct-01-2021, 03:25 PM
RE: Where's the endless loop? - by deanhystad - Oct-01-2021, 03:36 PM
RE: Where's the endless loop? - by snippsat - Oct-01-2021, 04:51 PM
RE: Where's the endless loop? - by Mark17 - Oct-01-2021, 06:22 PM
RE: Where's the endless loop? - by deanhystad - Oct-01-2021, 08:24 PM
RE: Where's the endless loop? - by Mark17 - Oct-04-2021, 04:30 PM
RE: Where's the endless loop? - by deanhystad - Oct-04-2021, 04:37 PM
RE: Where's the endless loop? - by Mark17 - Oct-04-2021, 04:44 PM
RE: Where's the endless loop? - by deanhystad - Oct-04-2021, 04:51 PM
RE: Where's the endless loop? - by Mark17 - Oct-04-2021, 05:51 PM
RE: Where's the endless loop? - by deanhystad - Oct-04-2021, 06:25 PM
RE: Where's the endless loop? - by Mark17 - Oct-04-2021, 06:54 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  PyRun_SimpleFile calling multiprocessing Python Class cause endless init loop Xeno 2 1,131 Sep-19-2022, 02:32 AM
Last Post: Xeno
  Endless printing of a table djwilson0495 2 1,874 Aug-10-2020, 01:42 PM
Last Post: djwilson0495
  while with try and except gets stuck in an endless loop? pcarra 3 4,765 Mar-27-2019, 07:50 PM
Last Post: pcarra

Forum Jump:

User Panel Messages

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