[Python] Adding image to pandas DataFrame

Discussão em 'Python' iniciado por Stack, Abril 21, 2025.

  1. Stack

    Stack Membro Participativo

    Suppose I have a DataFrame I want to export to a PDF. In the DataFrame I have the following columns: Code, Name, Price, Net, Sales. Every row is a Product.

    I want to add to every product in that DataFrame an image which i could get using BeautifulSoup. Is there some way to add the image to the DataFrame? Not the link, just the image of the product.

    Being more specific i want something like this:

    [​IMG]

    Code:

    import pandas as pd
    df = pd.DataFrame([['A231', 'Book', 5, 3, 150],
    ['M441', 'Magic Staff', 10, 7, 200]],
    columns = ['Code', 'Name', 'Price', 'Net', 'Sales')

    #Suppose this are the links that contains the imagen i want to add to the DataFrame
    images = ['Link 1','Link 2']

    Continue reading...

Compartilhe esta Página