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 8703081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:47:55+00:00 2026-06-13T02:47:55+00:00

There is an error earlier in the program that I am attempting to find,

  • 0

There is an error earlier in the program that I am attempting to find, but was asked to explain what is happening in this part of the code. Below is the code and what I think it is doing, but am unclear on some certain points. Some help in understanding would be greatly appreciated.

for title in titles:
    secString = 'sec_%02d' % (title)
    titleCitations = [c for c in cEdges if secString in c[0]]
    intraCitations = [c for c in titleCitations if secString in c[1]]
    print title, len(titleCitations), len(intraCitations), len(titleCitations) - len(intraCitations)

First, secString takes the remainder of 'sec_%02d' with respect to title, (I think this is just finding all strings that have a reference to a title?). It then creates a list titlecitations.

Though I am confused by the bracketed part. If I understand correctly, it takes the cEdge which I believe is just a list of a pairing of numbers from a given US legal code reference i.e. 26 USC 501 becomes just (26, 501), and asks if secString has a value in the c[0] spot.

(This is where I get confused; I am guessing that the c[0] spot maybe corresponds to the 26 in the above example and c[1] would correspond to the 501? Of course I am not even sure if I am understanding the c part correctly.)

Then put it in titlecitations if the c[0] spot is filled. It then creates the intracitations list. This list looks at the titlecitations list and asks if in secString is the c[1] filled and if so put it in this list.

I know there is a problem with something because titlecitations and intracitations appear to be the same list then.

  • 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-13T02:47:56+00:00Added an answer on June 13, 2026 at 2:47 am
    secString = 'sec_%02d' % (title)
    

    The % operator on a string isn’t modulus, it’s a formatting operator that behaves like C’s printf(). %02d is a formatting code that formats title as a two-digit number. If title is only one digit then it pads it with a 0 (e.g. 9 becomes 09).

    (This is where I get confused; I am guessing that the c[0] spot maybe corresponds to the 26 in the above example and c[1] would correspond to the 501? Of course I am not even sure if I am understanding the c part correctly.)

    That is correct.

    titleCitations = [c for c in cEdges if secString in c[0]]
    

    This searches through the items in cEdges and finds ones where the title contains the string sec_XY where XY is that two-digit number from earlier.

    intraCitations = [c for c in titleCitations if secString in c[1]]
    

    Now it searches through the things we found in the previous step, again searching for the sub-string sec_XY.

    The end result is that intraCitations contains a list of all the items from cEdges where both the first and second item contain the substring sec_XY.

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

Sidebar

Related Questions

OK, This is a method from my program that keeps giving the EXC_BAD_ACCESS error
So earlier I asked this question: JQuery Login Redirect. Code Included The php file
Is there an error with the following code? imagedashedline($image, $posax, $posay, $posbx, $posay, $black);
Recently I came across this error in my WCF trace: There was an error
I have found plenty of information out there about this error: 'ERROR: Could not
This relates to another question I asked earlier today. I built SVN 1.6.2 from
I have declared a DLL import in my C# program that looks like this:
I have a situation in a code where there is a huge function that
I'm attempting to create a client/server program, but I'm finding some difficulty continuing with
To start out with - this is not my code - there was a

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.