forked from sanidhya12345/Evaluating-Public-Anxiety
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdbread.py
27 lines (25 loc) · 745 Bytes
/
dbread.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import math
import pandas as pd
df=pd.read_csv('twitter_English.csv',usecols=['tweet','Name','Email'])
listtweet=[]
listname=[]
listemail=[]
for i in df['Email']:
listemail.append(i)
for i in df['tweet']:
listtweet.append(i)
for i in df['Name']:
listname.append(i)
dict={listtweet[i]:listname[i] for i in range(0,500)}
dict2={listtweet[i]:listemail[i] for i in range(0,500)}
keyword=input('Enter Keyword:- ')
# for i in listtweet:
# if i.find(keyword)!=-1:
# if dict.get(i)!=None:
# print(dict.get(i)+" "+dict2.get(i))
for i in listtweet:
count=0
if i.find(keyword)!=-1:
count+=1
if dict.get(i)!=None:
print(dict.get(i)+' ',dict2.get(i)+' ',(count/len(i))*100)