I have the below dataframe wherein I am trying to remove the first column which is the default column assigned in pandas dataframe/series. How do I get rid of that?
Actual result should be without the first column which has the "0". I have tried using reset index with drop but nothing works.
Here is my code which sends a mail with the dataframe output.
def send_email(index):
fromaddr = ""
toaddr = ""
msg = MIMEMultipart()
msg['From'] = fromaddr
msg['To'] = toaddr
msg['Subject'] = "Timestamp Alarm"
df1 = df.iloc[index,1:]
new = df1
body = """\
<html>
<head></head>
<body>
{0}
</body>
</html>
""".format(pd.DataFrame(new).T.to_html())
part1 = MIMEText(body,'html')
msg.attach(part1)
server = smtplib.SMTP("smtp.gmail.com", 587)
server.starttls()
server.login('***', '**')
server.sendmail('','',msg.as_string())
server.quit()