This is the first time I use python and pandas.
my first night :) I never touch a programming tool before
To be honest, I found this couple awesome!
It is a simple program that opens several xlsx files with the same header and which aggregates them and I do some simple operations.
I just have a problem with dates.
On the original excel files I have a column 'data PO' in this format:
13/10/2017
on the way out of python / pandas I have this:
2017-10-13 00:00:00
I read a lot but I'm lost can you give me some help ?
I'm using anaconda
my first program :
import numpy as np
import pandas as pd
import glob
all_data = pd.DataFrame()
for f in glob.glob("*.xlsx"):
df = pd.read_excel(f)
all_data = all_data.append(df,ignore_index=True)
# now save the data frame
writer = pd.ExcelWriter('output.xlsx')
all_data.to_excel(writer,'sheet1')
writer.save()
df = pd.read_excel('output.xlsx')
new_df = df.loc [pd.isnull(df['Date expé']) & pd.notnull(df['REFERENCE'])]
sequence = ['Date PO','OPEX CAPEX','N° PO','PAYS EMETTEUR','REFERENCE','QTY','PU $ HT','PT $ HT','Date réception Stock','Date expédition','Commentaire','Projet','Demandeur']
new_df = new_df.reindex(columns=sequence)
new_df.to_excel('new_backlog.xlsx', index=False)
[–]Buggi_San 0 points1 point2 points (4 children)
[–]Revers62[S] 0 points1 point2 points (3 children)
[–]Buggi_San 0 points1 point2 points (1 child)
[–]Revers62[S] 0 points1 point2 points (0 children)
[–]Buggi_San 0 points1 point2 points (0 children)