79803656

Date: 2025-10-29 10:21:04
Score: 2.5
Natty:
Report link

Thank you @Matt Pitkin, your comment gave me the idea to solve my problem by doing away with the function and, instead using

if (df['a'] == 0).any().any(): # Check if any zero exists in the entire DataFrame
    print("DataFrame contains zero values. Plotting aborted.")
else:
    plt.plot(dfd[1], df['a'], color='g', label='a')

This works fine for me, except for 'b' which has all zeros it plots a straight line at 0. What I want is to avoid printing loads of error line when the column has no data.
Reasons:
  • Blacklisted phrase (0.5): Thank you
  • RegEx Blacklisted phrase (1): I want
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Looks like a comment (1):
Posted by: Zilore Mumba