Comments (3)
Looks like distance_from_coordinates
is modifying the value of coords
. I'll fix this.
from hilbertcurve.
Adding the following to the distance_from_coordinates
function solves the problem -
if isinstance(coords, npy.ndarray):
x = coords.tolist()
else:
x = coords
from hilbertcurve.
you're snippet probably worked b/c when you have an instance of numpy array and you call tolist
you get a new object (and therefore don't modify the input). the problem would have remained for input that wasn't numpy arrays though. the PR I merged simply makes a copy of the input and operates on that. should fix your use case too. let me know if you get strange results. thanks for creating an issue!
from hilbertcurve.
Related Issues (12)
- rst docs on pypi HOT 4
- Some code verification HOT 1
- A question for coordinates HOT 1
- Include LICENSE in published source distribution HOT 3
- Formulas in the Readme HOT 2
- Feature request: numpy array compatibility HOT 7
- Version installed with "pip install hilbertcurve" is out of date HOT 3
- Random sampling methods
- 'HilbertCurve' object has no attribute 'coordinates_from_distance' HOT 1
- Documentation is outdated HOT 1
- I translated your code to C# HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hilbertcurve.