I have a table like this: enter image description here
I want only date column and units column (column 1 and 5), but with date in another format. I used code like this:
`import pandas as pd
customer_calls = pd.read_excel("sales.xlsx", usecols=[0, 4])
customer_calls["OrderDate"] = pd.to_datetime(customer_calls["OrderDate"]).dt.strftime("%Y%m%d" + "00")
customer_calls.to_excel("sales_YYYYMMDD.xlsx")
print(customer_calls)`
It gives me what I wanted: enter image description here
I need it without header and index. But when I use header=0 or header=None, then can not read line:
`customer_calls["OrderDate"] = pd.to_datetime(customer_calls["OrderDate"]).dt.strftime("%Y%m%d" + "00")`
cause there is no "Orderdate" name of column anymore. I tried to use 0 instead of name and all kind of stuff, but it always says error. How can I remove header and index but still choose date column after that?
I've read dozens of examples here, nothing solved this. Or I can no see it.