Posts by N.Peterson • 17 points
4 posts
-
1
votes2
answers1391
viewsQ: Concatenate two Dataframes
I need to generate a new dataframe with the concatenation of two dataframes. The following code works, but it takes a long time to run. df_concatena = pd.DataFrame() for x in range(len(df)): for y…
-
0
votes1
answer272
viewsQ: How to replace a certain sentence of a Python string? Using re.sub()
I would like to replace every expression that starts with characters: *:. tentativa = 'Olá td bem? *:palavra_proibida*985 td otimo' resultado = re.sub('*:', '', tentativa) Result Obtained: Olá td…
-
0
votes1
answer120
viewsQ: Find a certain word in a particular Tweepy user
Following the documentation, I was able to create a code that extracts tweets by tag, and another that extracts tweets from some user. But I’m having trouble extracting tweets from someone by tag.…
-
0
votes1
answer116
viewsQ: I need to read a . csv file and rewrite it into another . csv file without stopwords using Python
from nltk.corpus import stopwords from nltk.tokenize import word_tokenize from string import punctuation import csv texto = open('arquivo_sujo.csv','r').read() with open('arquivo_limpo.csv', 'w') as…