buscador-periodicos-dominicanos / carga_articulos.py
Lisibonny's picture
Upload 12 files
c188624 verified
raw
history blame
482 Bytes
import pandas as pd
import streamlit as st
@st.cache_data
def cargar_articulos():
articulos = pd.read_csv('articulos.csv')
articulos=articulos.iloc[0:100,:] # Cargando solo 20
# Eliminando la primera columna
articulos.drop("Unnamed: 0", axis=1, inplace=True)
# creando columna nueva ID
articulos['ID']=articulos.index
articulos.ID = pd.Series(["D"+str(ind) for ind in articulos.ID])
# Retornando el dataframe con los articulos
return articulos