Closed. This question is not written in English. It is not currently accepting answers.
Stack Overflow is an English-only site. The author must be able to communicate in English to understand and engage with any comments and/or answers their question receives. Don't translate this post for the author; machine translations can be inaccurate, and even human translations can alter the intended meaning of the post.
Closed 6 days ago.
Improve this question
C:\Users\hccha\anaconda3\lib\site-packages\openpyxl\worksheet_read_only.py:79 : UserWarning : L’extension inconnue n’est pas prise en charge et sera supprimée
Pour IDX, ligne dans parser.parse():
J' ai la solution ci dessous mais je prefere comprendre et corriger le probleme
import warnings
warnings.filterwarnings('ignore')
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 days ago.
Improve this question
def inicio():
try:
usuario=str(input("Ingresa tu usuario: "))
if usuario in usuarios:
indice = usuarios.index(usuario)
clave=(contraseñas[indice])
contraseña=str(input("ingrese su contraseña"))
if (contraseña==clave):
print("felicidades usted ha iniciado sesion")
except:
print("vuelva a refrecar el programa y intentelo de nuevo")
menu()
The except just doesn't work.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have bunch of lines and they can be categorized in 2 types.
Types of word Sequence:
Its a valid English sentence:
Exp: - As a committed Software Engineer with over 5 years of
experience on Microsoft Technologies and Business Intelligence
tools.
Not an valid English sentence(just word sequence):
Examples:
Client : PMP Auto Components
HTML , Cascading Style Sheets ,Java Script , JSP
Organization : Satyam Computer Services Ltd. , | ? | Designation : Software Engineer | ? | Duration : 03 / 2006 03
/ 2010 | ? |
SLC - STC Merit Certified - 2006 Satyam Computer Services Ltd.
I am using python for machine learning task.i can use POS tags as feature for classification by NLTK. Which algorithm can be applied in this problem ?
Update:
Which features should be utilized for prediction of whether its a sentences are not ?
You could use the treetaggerwrapper:
Reathedocs of TreetaggerWrapper
From the docs it should be easy to use:
import pprint # For proper print of sequences.
import treetaggerwrapper
#1) build a TreeTagger wrapper:
tagger = treetaggerwrapper.TreeTagger(TAGLANG='en')
#2) tag your text.
tags = tagger.tag_text("This is a very short text to tag.")
pprint.pprint(treetaggerwrapper.make_tags(tags))
Checking if the sentance holds a noun (tag NN), a verb (tag VBZ) and a proper sentence punctuation (tag SENT)
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I get the following error
ValueError: could not convert string to float: 'asdf\n'
from this code:
import sys
print('Hello, this is a short quiz. Please tell me your name')
name = int(sys.stdin.readline())
print('Are you ready %s?' % (name))
Unless your name is "7", that code is guaranteed to fail. You are casting the input string to an int. Try:
name = sys.stdin.readline().strip()
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 8 years ago.
Improve this question
I want to extract rule from tree structure without using Natural Language Toolkit(NLTK) .
For ex; The tree structure is:
( NP-TMP ( NNP December ) ( CD 1998 ) ) \n
and I want to extract rule such that:
NP-TMP -> NNP CD
NNP -> 'December'
CD -> '1998'
How can I do that with re library in Python without using "nltk"?
A very non elegant solution would be
import re
s_expr = "( NP-TMP ( NNP December ) ( CD 1998 ) )"
regex = re.compile("([\\w-]+)")
matches = re.findall(regex, s_expr)
# assert the s-expressions are 5
assert (len(matches) == 5)
print matches[0], matches[1], matches[3]
print matches[1], matches[2]
print matches[3], matches[4]
Here I assume all the s-expressions or trees have two descendents, if not, this is not gonna work and maybe a made-by-hand parser is better than a regex.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I'm building relatively complicated xpath expressions in Python, in order to pass them to selenium. However, its pretty easy to make a mistake, so I'm looking for a library that allows me to build the expressions without messing about with strings. For example, instead of writing
locator='//ul[#class="comment-contents"][contains(., "West")]/li[contains(., "reply")]
I could write something like:
import xpathbuilder as xpb
locator = xpb.root("ul")
.filter(attr="class",value="comment-contents")
.filter(xpb.contains(".", "West")
.subclause("li")
.filter(xpb.contains (".", "reply"))
which is maybe not as readable, but is less error-prone. Does anything like this exist?
though this is not exactly what you want.. you can use css selector
...
import lxml.cssselect
csssel = 'div[class="main"]'
selobj = lxml.cssselect.CSSSelector(csssel)
elements = selobj(documenttree)
generated XPath expression is in selobj.path
>>> selobj.path
u"descendant-or-self::div[#class = 'main']"
You can use lxml.etree that allows to write code as the following:
from lxml.builder import ElementMaker # lxml only !
E = ElementMaker(namespace="http://my.de/fault/namespace", nsmap={'p' : "http://my.de/fault/namespace"})
DOC = E.doc
TITLE = E.title
SECTION = E.section
PAR = E.par
my_doc = DOC(
TITLE("The dog and the hog"),
SECTION(
TITLE("The dog"),
PAR("Once upon a time, ..."),
PAR("And then …")
),
SECTION(
TITLE("The hog"),
PAR("Sooner or later …")
)
)