Posts by Mueladavc • 161 points
7 posts
-
1
votes1
answer436
viewsQ: Capture groups where a specific word appears with Regex
I have the following situation: text_1 = O cachorro correu com o gato text_2 = O carro passou e o cachorro foi atrás text_3 = Sempre que chego em casa meu cachorro pula em mim text_4 = Ele foi…
-
0
votes3
answers3678
viewsA: How to remove unwanted words from a text?
For me the best way would be with Regular Expressions: import re text = 'Oi, eu sou Goku e estou indo para a minha casa' palavras = ['a','e'] for i in palavras: text =…
-
8
votes1
answer9340
viewsQ: How to tokenize English words using NLTK?
I’m having serious difficulties understanding this mechanism. In English it would just be: import nltk tag_word = nltk.word_tokenize(text) Whereas text is the English text that I would like to…
-
2
votes1
answer190
viewsQ: Make different combinations of words within a sentence
As an example I have the following sentence: texto = O gato subiu no telhado de 10m, um homem jogou-lhe uma pedra e ele caiu de uma altura de 20m. I want to extract the following information: (O…
-
1
votes2
answers1966
viewsQ: Pandas Soma Condicional
Hello. I have the following situation df1 = pd.DataFrame({'Key':['a','b','c','a','c','a','b','c'],'Value':[9.2,8.6,7.2,8.3,8.5,2.1,7.4,1.1]}) df2 = pd.DataFrame({'Key':['a','b','c']}) and would like…
-
2
votes1
answer401
viewsQ: Creating data set for sklearn with dataframe pandas
I have the following situation from sklearn.linear_model import LogisticRegression import pandas as pd x = pd.DataFrame({'A':[1,3,8,6,1],'B':[2,6,9,3,2]}) y = pd.DataFrame({'C':[8,6,3,6,1]}) How do…
-
0
votes1
answer69
viewsQ: How to have boolean results from the interaction of two lists?
How to have boolean results from the interaction of two lists? That is to say: a = [1,2,3,4,5] b = [2,4] for each item in a belonging to b return true…
python-3.xasked Mueladavc 161