Add date column

This commit is contained in:
Vivek Teega 2020-04-24 15:39:58 +05:30 committed by GitHub
parent 844fd2f04c
commit 4995a9d249
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,9 +14,9 @@ def homepage():
# read user files and display likes and tweet
newdf = pd.DataFrame()
for idx, filename in enumerate(files):
userdata = pd.read_csv(os.path.join(csv_folderpath,filename), usecols=['username','likes_count','tweet','time'])
userdata = pd.read_csv(os.path.join(csv_folderpath,filename), usecols=['username','likes_count','tweet','time','date'])
newdf = newdf.append(userdata.loc[0])
newdf = newdf[['username','time','likes_count','tweet']]
newdf = newdf[['username','date','time','likes_count','tweet']]
return render_template('index.html', tables=[newdf.to_html(classes='data', index=False)], titles=newdf.columns.values)