Commit 716bae7e authored by Victor Viana Cespedes's avatar Victor Viana Cespedes 💬
Browse files

cuarto commit

parent 57b3dd25
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -2,90 +2,45 @@ import numpy as np
import pandas as pd
#lee cada hoja de la planilla HS_0818a0719 - 1 de 2.xlsx
with pd.ExcelFile('HS_0818a0719 - 1 de 2.xlsx') as xlsx1:
# lee cada archivo CSV de la carpeta clasificacion, Parte 1
hoja1_1 = pd.read_excel(xlsx1, '01a15_08_18')
df1 = pd.read_csv('clasificacion/LS_08_18.csv')
hoja2_1 = pd.read_excel(xlsx1, '16a31_08_18')
df2 = pd.read_csv('clasificacion/LS_09_18.csv')
hoja3_1 = pd.read_excel(xlsx1, '01a15_09_18')
df3 = pd.read_csv('clasificacion/LS_10_18.csv')
hoja4_1 = pd.read_excel(xlsx1, '16a30_09_18')
hoja5_1 = pd.read_excel(xlsx1, '01a15_10_18')
hoja6_1 = pd.read_excel(xlsx1, '16a31_10_18')
hoja7_1 = pd.read_excel(xlsx1, '01a15_11_18')
hoja8_1 = pd.read_excel(xlsx1, '16a30_10_18')
hoja9_1 = pd.read_excel(xlsx1, '12_18')
df4 = pd.read_csv('clasificacion/LS_11y12_18.csv')
# concatena todas las hojas en una sola tabla
parte1 = pd.concat([hoja1_1, hoja2_1, hoja3_1, hoja4_1, hoja5_1, hoja6_1, hoja7_1, hoja8_1, hoja9_1])
print parte1
'''
#lee cada hoja de la planilla HS_0818a0719 - 1 de 2.xlsx
with pd.ExcelFile('HS_0818a0719 - 1 de 2.xlsx') as xlsx2:
hoja1_2 = pd.read_excel(xlsx2, '01_19')
parte1 = pd.concat([df1, df2, df3, df4])
hoja2_2 = pd.read_excel(xlsx2, '01a15_02_19')
#print parte1
hoja3_2 = pd.read_excel(xlsx2, '16a28_02_19')
# lee cada archivo CSV de la carpeta clasificacion, Parte 2
hoja4_2 = pd.read_excel(xlsx2, '01a15_03_19')
df5 = pd.read_csv('clasificacion/LS_01y02_19.csv')
hoja5_2 = pd.read_excel(xlsx2, '16a31_03_19')
df6 = pd.read_csv('clasificacion/LS_03y04_19.csv')
hoja6_2 = pd.read_excel(xlsx2, '01a15_04_19')
df7 = pd.read_csv('clasificacion/LS_05_19.csv')
hoja7_2 = pd.read_excel(xlsx2, '16a30_04_19')
hoja8_2 = pd.read_excel(xlsx2, '01a15_05_19')
hoja9_2 = pd.read_excel(xlsx2, '16a31_05_19')
hoja10_2 = pd.read_excel(xlsx2, '01a15_06_19')
hoja11_2 = pd.read_excel(xlsx2, '16a30_06_19')
hoja12_2 = pd.read_excel(xlsx2, '01a15_07_19')
hoja13_2 = pd.read_excel(xlsx2, '16a31_07_19')
df8 = pd.read_csv('clasificacion/LS_06y07_19.csv')
# concatena todas las hojas en una sola tabla
parte2 = pd.concat([hoja1_2, hoja2_2, hoja3_2, hoja4_2, hoja5_2, hoja6_2, hoja7_2, hoja8_2, hoja9_2, hoja10_2, hoja11_2, hoja13_2])
aserradero = pd.concat([part1, parte2])
print aserradero
'''
'''
#lee cada hoja de la planilla LS_08_18a07_19 - 1de2
parte2 = pd.concat([df5, df6, df7, df8])
with pd.ExcelFile('LS_08_18a07_19 - 1de2') as xlsx3:
#print parte2
hoja1_3 = pd.read_excel(xlsx, 'LS_08_18')
# se obtiene el dataset completo
clasificacion = pd.concat([parte1, parte2])
hoja2_3 = pd.read_excel(xlsx, 'LS_09_18')
#print clasificacion
hoja3_3 = pd.read_excel(xlsx, 'LS_10_18')
# se hace el filtrado de las trozas no rechazadas
clasificacion = clasificacion[clasificacion['Rejected'] == 'N']
hoja4_3 = pd.read_excel(xlsx, 'LS_11y12_18')
'''
'''
df = pd.merge(df1, df2, on='Number')
# se agrupa cada treza por tipo (BIN)
print(clasificacion.groupby('Bin')['Number'].count())
df = df[df['Rejected'] == 'N']
print(df.groupby('Bin')['Number'].count())
'''
import numpy as np
import pandas as pd
#lee cada hoja de la planilla HS_0818a0719 - 1 de 2.xlsx
with pd.ExcelFile('HS_0818a0719 - 1 de 2.xlsx') as xlsx1:
hoja1_1 = pd.read_excel(xlsx1, '01a15_08_18')
hoja2_1 = pd.read_excel(xlsx1, '16a31_08_18')
hoja3_1 = pd.read_excel(xlsx1, '01a15_09_18')
hoja4_1 = pd.read_excel(xlsx1, '16a30_09_18')
hoja5_1 = pd.read_excel(xlsx1, '01a15_10_18')
hoja6_1 = pd.read_excel(xlsx1, '16a31_10_18')
hoja7_1 = pd.read_excel(xlsx1, '01a15_11_18')
hoja8_1 = pd.read_excel(xlsx1, '16a30_10_18')
hoja9_1 = pd.read_excel(xlsx1, '12_18')
# concatena todas las hojas en una sola tabla
parte1 = pd.concat([hoja1_1, hoja2_1, hoja3_1, hoja4_1, hoja5_1, hoja6_1, hoja7_1, hoja8_1, hoja9_1])
print parte1
'''
#lee cada hoja de la planilla HS_0818a0719 - 1 de 2.xlsx
with pd.ExcelFile('HS_0818a0719 - 1 de 2.xlsx') as xlsx2:
hoja1_2 = pd.read_excel(xlsx2, '01_19')
hoja2_2 = pd.read_excel(xlsx2, '01a15_02_19')
hoja3_2 = pd.read_excel(xlsx2, '16a28_02_19')
hoja4_2 = pd.read_excel(xlsx2, '01a15_03_19')
hoja5_2 = pd.read_excel(xlsx2, '16a31_03_19')
hoja6_2 = pd.read_excel(xlsx2, '01a15_04_19')
hoja7_2 = pd.read_excel(xlsx2, '16a30_04_19')
hoja8_2 = pd.read_excel(xlsx2, '01a15_05_19')
hoja9_2 = pd.read_excel(xlsx2, '16a31_05_19')
hoja10_2 = pd.r"ead_excel(xlsx2, '01a15_06_19')
hoja11_2 = pd.read_excel(xlsx2, '16a30_06_19')
hoja12_2 = pd.read_excel(xlsx2, '01a15_07_19')
hoja13_2 = pd.read_excel(xlsx2, '16a31_07_19')
# concatena todas las hojas en una sola tabla
parte2 = pd.concat([hoja1_2, hoja2_2, hoja3_2, hoja4_2, hoja5_2, hoja6_2, hoja7_2, hoja8_2, hoja9_2, hoja10_2, hoja11_2, hoja13_2])
aserradero = pd.concat([part1, parte2])
print aserradero
'''
'''
#lee cada hoja de la planilla LS_08_18a07_19 - 1de2
with pd.ExcelFile('LS_08_18a07_19 - 1de2') as xlsx3:
hoja1_3 = pd.read_excel(xlsx, 'LS_08_18')
hoja2_3 = pd.read_excel(xlsx, 'LS_09_18')
hoja3_3 = pd.read_excel(xlsx, 'LS_10_18')
hoja4_3 = pd.read_excel(xlsx, 'LS_11y12_18')
'''
'''
df = pd.merge(df1, df2, on='Number')
df = df[df['Rejected'] == 'N']
print(df.groupby('Bin')['Number'].count())
'''
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment