Python Forum
Why the blank lines in output?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why the blank lines in output?
#1
I'm having problems with my program so I added a tracer (?) line to print out some variables at the beginning of every iteration [loop]:

if current_date != current_date_prev: #debug
    print(f'current_date is {current_date}, common date is {datetime.utcfromtimestamp(current_date*86400).strftime("%Y-%m-%d")}, trade status is {trade_status}, and control flag is {control_flag}.')
    current_date_prev = current_date
Here's a segment of the output:

Output:
current_date is 14692, common date is 2010-03-24, trade status is INCEPTION, and control flag is find_spread. current_date is 14693, common date is 2010-03-25, trade status is IN_TRADE, and control flag is update_long. current_date is 14694, common date is 2010-03-26, trade status is IN_TRADE, and control flag is update_long. current_date is 14697, common date is 2010-03-29, trade status is IN_TRADE, and control flag is update_long. current_date is 14698, common date is 2010-03-30, trade status is IN_TRADE, and control flag is update_long. current_date is 14699, common date is 2010-03-31, trade status is IN_TRADE, and control flag is update_long. current_date is 14700, common date is 2010-04-01, trade status is IN_TRADE, and control flag is update_long. current_date is 14704, common date is 2010-04-05, trade status is IN_TRADE, and control flag is update_long. current_date is 14705, common date is 2010-04-06, trade status is IN_TRADE, and control flag is update_long. current_date is 14706, common date is 2010-04-07, trade status is IN_TRADE, and control flag is update_long. current_date is 14707, common date is 2010-04-08, trade status is INCEPTION, and control flag is find_spread. current_date is 14733, common date is 2010-05-04, trade status is INCEPTION, and control flag is find_spread. current_date is 14734, common date is 2010-05-05, trade status is IN_TRADE, and control flag is update_long. current_date is 14735, common date is 2010-05-06, trade status is IN_TRADE, and control flag is update_long. current_date is 14736, common date is 2010-05-07, trade status is IN_TRADE, and control flag is update_long.
Periodically, I get blank lines as seen after current_date 14698. Do you have any idea why that might be the case? The task should be as repetitive as it looks. I get roughly 3500 of these tracer lines total (from 2007 through 2021).

In case it matters, I'm using Jupyter Notebook for this.
Reply


Messages In This Thread
Why the blank lines in output? - by Mark17 - Jun-27-2022, 06:24 PM
RE: Why the blank lines in output? - by Mark17 - Jun-27-2022, 06:34 PM
RE: Why the blank lines in output? - by deanhystad - Jun-27-2022, 06:37 PM
RE: Why the blank lines in output? - by Mark17 - Jun-27-2022, 06:45 PM
RE: Why the blank lines in output? - by deanhystad - Jun-27-2022, 07:24 PM
RE: Why the blank lines in output? - by DeaD_EyE - Jun-27-2022, 07:53 PM
RE: Why the blank lines in output? - by Mark17 - Jun-27-2022, 11:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to insert Dashed Lines in between Rows of a tabulate output Mudassir1987 0 546 Sep-27-2023, 10:09 AM
Last Post: Mudassir1987
  Remove Blank Lines from docx table and paragraphs bsudhirk001 1 3,758 Feb-14-2021, 12:38 AM
Last Post: Larz60+
  Iterate 2 large text files across lines and replace lines in second file medatib531 13 6,040 Aug-10-2020, 11:01 PM
Last Post: medatib531
  CSV gives me blank row on PC, but not a Mac bazcurtis 2 2,855 Jan-06-2020, 08:40 AM
Last Post: buran
  re.finditer issue, output is blank anna 1 2,404 Feb-07-2019, 10:41 AM
Last Post: stranac
  25 blank lines in my sorted_fruits output list! raven61 7 4,357 Aug-09-2018, 11:30 PM
Last Post: raven61

Forum Jump:

User Panel Messages

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