当前位置:网站首页>Length n of condensed distance matrix ‘y‘ must be a binomial coefficient
Length n of condensed distance matrix ‘y‘ must be a binomial coefficient
2022-08-03 05:10:00 【xiaozheng123121】
在利用层次聚类算法的时候,报错:
ValueError: Length n of condensed distance matrix 'y' must be a binomial coefficient, i.e.there must be a k such that (k \choose 2)=n)!
import scipy.cluster.hierarchy as hcluster
df = df.iloc[:2000, :].apply(lambda x: sum(x), axis=1)
linkage = hcluster.linkage(df, method='centroid')
注:我的df是一个Series,而不是dataframe,改成Dataframe格式即可
linkage = hcluster.linkage(pd.DataFrame(df), method='centroid')
参考资料
[1] scipy.cluster.hierarchy.linkage 2020.5
边栏推荐
- 【Biotin Azide|cas:908007-17-0】Price_Manufacturer
- typescript42-readonly修饰符
- Coordinate knowledge in digital twin campus scenarios
- How to prepare for the test interface test data
- 【 Harmony OS 】 【 ano UI 】 lightweight data storage
- Exception (abnormal) and Error (error) difference analysis
- ModelArts第二次培训
- ss-2.子项目互相访问(order80 -> payment8001)
- mysql 存储过程 动态参数 查询执行结果
- [Fine talk] Using native js to implement todolist
猜你喜欢

typescript47-函数之间的类型兼容性

第四次培训

Peptides mediated PEG DSPE of phospholipids, targeted functional materials - PEG - RGD/TAT/NGR/APRPG

Unity2D horizontal board game tutorial 6 - enemy AI and attack animation

Redis6学习笔记

【Harmony OS】【ARK UI】ets use startAbility or startAbilityForResult to invoke Ability

UV decomposition of biotin - PEG2 - azide | CAS: 1192802-98-4 biotin connectors

Kaggle 入门(Kaggle网站使用及项目复现)

ModelArts第二次培训

Detailed explanation of MOSN reverse channel
随机推荐
typescript41-class类的私有修饰符
1060 爱丁顿数 (25 分)
Alienware上线首个数字时装AR试穿体验
UV decomposition of biotin - PEG2 - azide | CAS: 1192802-98-4 biotin connectors
[Harmony OS] [ArkUI] ets development graphics and animation drawing
FileZilla 搭建ftp服务器
presto安装部署教程
web安全-命令执行漏洞
junit总结
Tag stack - stack monotonically preparatory knowledge - lt. 739. The daily temperature
Odps temporary query can write SQL, turned out to a named?
传说中可“免费白拿”的无线路由器 - 斐讯 K2 最简单刷 breed 与第三方固件教程
第三次HarmonyOS培训
Common fluorescent dyes to modify a variety of groups and its excitation and emission wavelength data in the data
web安全-sql注入漏洞
GIS数据漫谈(六)— 投影坐标系统
typescript47-函数之间的类型兼容性
网络流媒体下载的 10 种方法(以下载 Echo 音乐为例)
Interface testing framework of actual combat (2) | interface request assertion
Build your own web page on raspberry pie (1)