我实现了一个类来存储推文:
class Twitter_User():
def __init__(self,id,count=200):
self.id = id
self.count = count
def get_tweets(self):
store_tweets = api.user_timeline(self.id, count=self.count)
simple_list = []
for status in store_tweets:
array = [status._json["text"], status._json["favorite_count"], status._json["created_at"],status._json["retweet_count"]]
simple_list.append(array)
data = pd.DataFrame(simple_list, columns=["Text", "Like", "Created at","Retweet"])
return data
现在我希望通过Text colums删除所有转发(以" RT"开头的文本),我该如何获得?用正则表达式和应用还是有更简单的方法?