Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7879897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:00:36+00:00 2026-06-03T04:00:36+00:00

c = file(‘cluster_info.txt’) for i in zip(ys[-10:],result): # has ten elements for j in

  • 0
c = file('cluster_info.txt')
for i in zip(ys[-10:],result): # has ten elements
    for j in c.readlines():
        cluster = j.split(',')
        if q in cluster:
            m = (q[i],cluster[0])
            f = pylab.figure() # code for plot starts here
            for n, fname in enumerate(m):
                image=Image.open(fname).convert("L")
                arr=np.asarray(image)
                f.add_subplot(2, 1, n)  # this line outputs images on top of each other
                pylab.imshow(arr,cmap=cm.Greys_r)
            pylab.title("%s, Top:Predicted,Bottom:Observed" %i[0])
            pylab.show()
        else:
            continue

This is a snippet from a larger code, and I expect to produce 10 images/plots but no plots are produced by python. I think I am not nesting the if and else: correctly in the for loop. Please tell me what is wrong here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T04:00:37+00:00Added an answer on June 3, 2026 at 4:00 am

    what is your intention of else: continue? if you want to continue with the outer loop (i), you’d better use else:break. otherwise you may just as well delete the else branch

    also, i does not seem to be used in your loop at all? it can’t be right

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

file.contain.query.txt ENST001 ENST002 ENST003 file.to.search.in.txt ENST001 90 ENST002 80 ENST004 50 Because ENST003 has
FILE *out=fopen64(text.txt,w+); unsigned int write; char *outbuf=new char[write]; //fill outbuf printf(%i\n,ftello64(out)); fwrite(outbuf,sizeof(char),write,out); printf(%i\n,write); printf(%i\n,ftello64(out));
file.txt contains: ##w## ##wew## using mac 10.6, bash shell, the command: cat file.txt |
File.open(path, 'r').each do |line| row = line.chomp.split('\t') puts #{row[0]} end path is the path
FILE *f; char buffer[201]; f=fopen(file.txt,r); if (f==NULL) { printf(file doesn't exist?!\n);return 1; } while(1)
file = io.open('spam.txt', 'w') file.write(u'Spam and eggs!\n') file.close() ....(Somewhere else in the code) file
File /usr/lib/python3.1/codecs.py, line 300, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf8'
File foo.txt exists on the remote machine at: /home/user/foo.txt It doesn't exist on the
file_name = models.FileField(upload_to=settings.PATH, verbose_name=_('Upload_Path'), \ null=True, blank=True, help_text=' .zip file only') When I rendring
FILE *fp; fp=fopen(c:\\test.txt, r); int fgetc (FILE *fp); int fputc( int c, FILE *fp

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.