Update carga_articulos.py
Browse files- carga_articulos.py +3 -3
carga_articulos.py
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
import pandas as pd
|
2 |
import streamlit as st
|
3 |
from dateutil.parser import parse
|
|
|
|
|
4 |
|
5 |
@st.cache_data
|
6 |
def cargar_articulos():
|
@@ -11,9 +13,7 @@ def cargar_articulos():
|
|
11 |
# creando columna nueva ID
|
12 |
articulos['ID']=articulos.index
|
13 |
articulos.ID = pd.Series(["D"+str(ind) for ind in articulos.ID])
|
14 |
-
fechas=articulos['fecha'].apply(lambda x:
|
15 |
-
fechas=fechas.astype(str)
|
16 |
-
fechas=fechas.apply(lambda x: re.match('\d{4}-\d{2}-\d{2}',x).group())
|
17 |
fecha_minima=fechas.min()
|
18 |
fecha_maxima=fechas.max()
|
19 |
# Retornando el dataframe con los articulos y algunos datos al respecto
|
|
|
1 |
import pandas as pd
|
2 |
import streamlit as st
|
3 |
from dateutil.parser import parse
|
4 |
+
import locale
|
5 |
+
locale.setlocale(locale.LC_ALL, 'esp_esp')
|
6 |
|
7 |
@st.cache_data
|
8 |
def cargar_articulos():
|
|
|
13 |
# creando columna nueva ID
|
14 |
articulos['ID']=articulos.index
|
15 |
articulos.ID = pd.Series(["D"+str(ind) for ind in articulos.ID])
|
16 |
+
fechas=articulos['fecha'].apply(lambda x: x.strftime('%Y-%m-%d'))
|
|
|
|
|
17 |
fecha_minima=fechas.min()
|
18 |
fecha_maxima=fechas.max()
|
19 |
# Retornando el dataframe con los articulos y algunos datos al respecto
|