当前位置:网站首页>jenkspy包安装
jenkspy包安装
2022-04-23 05:46:00 【今天学习要很快乐鸭】
jenkspy包安装避坑*
用jenkspy实现arcgis中的自然断点法,安装过程中出现了很多问题:
坑一:我的电脑配有Python2.7,Python3.9两个环境,如果直接pip install jenkpy ,那么系统显示unable to create…,就是说系统区分不了pip是python2还是python3的路径
如何设置多个python环境
坑二:解决一后,我在python3环境下进行安装 python3 -m pip install jenkspy,显示的错误是无法安装该tar.gz文件,后来发现是python版本与之不匹配,jenkspy最新版只支持到3.8,恰好没有3.9的版本。。。有低于3.9版本的应该可以直接装,如果显示runtimeerror,可以根据python版本去下载对应的压缩包,链接为:
jenkspy
坑三:我不想重装3.8的python版本,于是尝试用python2下载,结果显示新错误:Microsoft Visual C++ 9.0 is required。。然后全网找资源,找到了VCForPython27.msi8进行下载,然后问题成功解决。
坑四:虽然装上了,但是运行会报错,所以我修改了core.py的源码后,可以成功运行了:
from collections.abc import Iterable
改为from collections import Iterable
from math import isfinite
改为 import math
values = [i for i in values if isfinite(i)]
改为values = [i for i in values if np.isfinite(i)]
代码实践
import jenkspy
import random
''' jenks_breaks( [1.3, 7.1, 7.3, 2.3, 3.9, 4.1, 7.8, 1.2, 4.3, 7.3, 5.0, 4.3], nb_class = 3) # Should output (1.2, 2.3, 5.0, 7.8) '''
list_of_values = [1.3, 7.1, 7.3, 2.3, 3.9, 4.1, 7.8, 1.2, 4.3, 7.3, 5.0, 4.3]
breaks = jenkspy.jenks_breaks(list_of_values, nb_class=3)
print(breaks)
运行结果正确:
版权声明
本文为[今天学习要很快乐鸭]所创,转载请带上原文链接,感谢
https://blog.csdn.net/ShirleyLGY/article/details/124322570
边栏推荐
- 1007 go running (hdu6808) in the fourth game of 2020 Hangzhou Electric Multi school competition
- Gesture recognition research
- Understanding and installing MySQL
- Troubleshooting of data deleted and reappeared problems
- 线程和进程的关系和区别是什么
- Type conversion in C #
- Animation - Introduction to keyframes
- [transfer] MySQL: how many rows of data can InnoDB store in a B + tree?
- [untitled] database - limit the number of returned rows
- Solution to the trial of ycu Blue Bridge Cup programming competition in 2021
猜你喜欢
自动控制原理知识点整合归纳(韩敏版)
Techniques et principes de détection
SQL -- data filtering and grouping
Robocode教程7——雷达锁定
Gesture recognition research
Installation and usage skills of idea
MySQL table constraints and table design
Substring Inversion (Easy Version)
How SYSTEMd uses / etc / init D script
Type conversion in C #
随机推荐
爬西瓜视频url
用C语言实现重写strcmp等四个函数
GDAL+OGR学习
基于pygame库编写的五子棋游戏
电机与拖动(戚金清版)学习整理
GNU EFI header file
C # Foundation
Object转Json差异之Gson fastJson jackson 修改字段名
基于QQwebAPI 查询昵称和头像的爬虫
Option的正确打开方式
Rust 中的 RefCell
检测技术与原理
Rust 中的 Cell 共享可变指针
Use of multithreaded executors
xlsxwriter.exceptions.FileCreateError: [Errno 13] Permission denied问题
Example of reentrant lock thread waiting to wake up
Event listener
Collection and map thread safety problem solving
Motor and drive (Qi Jinqing Edition)
Feign请求日志统一打印