Reputation: 1700
I am trying to show csv files on html content but I havent done properly up to now. Want to show html content without using models because the length or headers is not fixed this is dependable on tasks. This doesnt show proper format. Code;
df = pd.read_csv(f_path)
objects = df.to_html(header=None)return
HttpResponse(objects)
csv content
html output
Upvotes: 0
Views: 254
Reputation: 1260
Try calling out the separator in your data, which looks to be ;
. Also set your index to be the first column and establish your column names.
df = pd.read_csv(f, sep=';', index_col=0)
df.columns =['Epoch', 'Data']
Upvotes: 1