You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ami_scores= []
# for each cluster solutionfori_cluster_typein ("k5cls", "ward5", "ward5wq", "ward5wknn"):
# for every other clusteringforj_cluster_typein ("k5cls", "ward5", "ward5wq", "ward5wknn"):
# compute the adjusted mutual info between the twoami_score=metrics.adjusted_mutual_info_score(
db[i_cluster_type], db[j_cluster_type]
)
# and save the pair of cluster types with the scoreami_scores.append((i_cluster_type, j_cluster_type, ami_score))
# arrange the results into a dataframeresults=pandas.DataFrame(
ami_scores, columns=["source", "target", "similarity"]
)
# and spread the dataframe out into a squareresults.pivot("source", "target", "similarity")
Currently returns (with pandas 2.1.1) the following error:
---------------------------------------------------------------------------TypeErrorTraceback (mostrecentcalllast)
CellIn[40], line1713results=pandas.DataFrame(
14ami_scores, columns=["source", "target", "similarity"]
15 )
16# and spread the dataframe out into a square--->17results.pivot("source", "target", "similarity")
TypeError: pivot() takes1positionalargumentbut4weregiven
The text was updated successfully, but these errors were encountered:
Cell 40 (last one of code):
Currently returns (with
pandas
2.1.1) the following error:The text was updated successfully, but these errors were encountered: