Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Syndicate_Admin
Administrator
Administrator

Importar imagen con script de Python

Hola

Estoy buscando un método para cargar varias imágenes con Python scipt en el escritorio de Power BI para crear un panel. No quiero seleccionar imágenes manualmente e importarlas. Aquí está mi código actual y el power bi no pudo reconocer la imagen. Estoy usando Get Data with Python Script. ¿Hay alguna manera de resolver este problema? ¿O hay algún método detallado alternativo para importar imágenes con script en Power BI?

import pandas as pd
import json
import matplotlib.pyplot as plt 
import matplotlib.cbook as cbook


#ax=plt.gca()
with cbook.get_sample_data('D:/carapace/TableauChartDisplayTask/test.png') as image_file:
    image=plt.imread(image_file)

fig, ax = plt.subplots()
  
fig.figimage(image)
#fig.figimage(image, 10, 10, zorder = 3, alpha =.5)
  
plt.title('matplotlib.pyplot.imread() function Example', 
                                     fontweight ="bold")
plt.show()

Y aquí está el resultado

Eraclea_0-1655480623660.png

Gracias

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

@Eraclea ,

Debe usar el visual de Python en lugar del script de Python.

vchenwuzmsft_0-1655887458307.png

Saludos

Equipo de apoyo a la comunidad _ chenwu zhu

Si esta publicación ayuda, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla más rápidamente.

Syndicate_Admin
Administrator
Administrator

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.