I read the solution but I have no idea do the code mean, i copy the code to see the result, but it showed error.Could anyone help explain what we are doing at this step and why the code does not work? Thank you!
Screen Link: https://app.dataquest.io/m/469/guided-project%3A-popular-data-science-questions/9/enter-domain-knowledge
My Code:
relations_most_used = associations.loc[most_used.index, most_used.index]
def style_cells(x):
helper_df = pd.DataFrame('', index=x.index, columns=x.columns)
helper_df.loc["time-series", "r"] = "background-color: yellow"
helper_df.loc["r", "time-series"] = "background-color: yellow"
for k in range(helper_df.shape[0]):
helper_df.iloc[k,k] = "color: blue"
return helper_df
relations_most_used.style.apply(style_cells, axis=None)