Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

1
Question about for loops ?
Post Body

In this code

import spacy

txt = 'List is a ubiquitous data structure in the Python programming language.'

nlp = spacy.load('en') doc = nlp(txt) for t in doc: print(t.text, t.head.text)

I know that the t is usually a variable assigned to each thing on a list and in this case it’s assigned to each word I know the loop is iterating through the string basically.My question is what does the t have to do in t.text and etc it just apart of the spacy library or can it be used else in my other programming. I tried to make a simple for loop in my ide

Greeting = “hello”

For I in range(5): print(I.greeting)

But it gives me an attribute error.So thinking it’s just a spacy thing!Would love to hear someone more knowledgeable opinion

Author
Account Strength
50%
Account Age
4 years
Verified Email
No
Verified Flair
No
Total Karma
153
Link Karma
87
Comment Karma
66
Profile updated: 1 day ago
Posts updated: 6 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
2 years ago