Forum Discussion
MarcialMartín
2 years agoNew Member
TypeError: unhashable type: 'slice'
Hi community. I have a visual based on python that works fine on my desktop version but when I publish it I received the following error: TypeError: unhashable type: 'slice' The script code ...
Sahir_Maharaj
2 years agoSuper User
Hello MarcialMartín,
Can you please try this updated script:
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
# Assuming 'dataset' is a predefined DataFrame
dataset["Timestamp"] = dataset["Year"].astype(str) + " " + dataset["Month"].astype(str)
principles = dataset.drop(columns=["Timestamp", "Month", "Year"]).iloc[0].index.tolist()
timestamp = dataset["Timestamp"]
heatmap = np.array([
dataset["Principle_1"].round(2),
dataset["Principle_2"].round(2),
dataset["Principle_3"].round(2),
dataset["Principle_4"].round(2),
dataset["Principle_5"].round(2),
dataset["Principle_6"].round(2),
dataset["Principle_7"].round(2),
dataset["Principle_8"].round(2)
])
# ... rest of your plotting code remains the same ...
Should you require any further assistance, please do not hesitate to reach out to me.
- MarcialMartín2 years agoNew Member
Hi Sahir_Maharaj.
Thank you so much for your answer. I have tried your solution but the problem persists.
In the desktop version it is working well:
But when I publish it and try to visualice in the web version of PowerBI I received this:
Any support is welcome cause the only thing that I can imagine is that the desktop version is not supporting the libraries version.
Thanks in advance.