当前位置:网站首页>Jenkspy package installation

Jenkspy package installation

2022-04-23 18:00:00 Be happy to study today

jenkspy Bag installation pit *

use jenkspy Realization arcgis Natural breakpoint method in , There are many problems in the installation process :

A pit : My computer is equipped with Python2.7,Python3.9 Two environments , If direct pip install jenkpy , Then the system displays unable to create…, That means the system can't distinguish pip yes python2 still python3 The path of

How to set up multiple python Environmental Science

Pit two : After solving a problem , I am here python3 Installation in environment python3 -m pip install jenkspy, The error displayed is that the... Cannot be installed tar.gz file , Later it was found that python The version doesn't match ,jenkspy The latest version only supports up to 3.8, It happens that there is no 3.9 Version of ... There is less than 3.9 The version should be able to be installed directly , If it shows runtimeerror, According to python Version to download the corresponding compressed package , Link to :

jenkspy

Pit three : I don't want to reload 3.8 Of python edition , So try to use python2 download , The result shows a new error :Microsoft Visual C++ 9.0 is required.. Then the whole network looks for resources , eureka VCForPython27.msi8 Download , Then the problem is solved successfully .

 Insert picture description here

Pit four : Even though it's loaded with , But the operation will report an error , So I modified core.py After the source code , It's running successfully :

from collections.abc import Iterable
Change it to from collections import Iterable

from math import isfinite
Change it to import math

values = [i for i in values if isfinite(i)]
Change it to values = [i for i in values if np.isfinite(i)]

Code practice

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)

The running result is correct :
 Insert picture description here

版权声明
本文为[Be happy to study today]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230545528196.html