Comments (1)
For the record, for a simple calculation, raw seems to work better. My hunch is numpy would be valuable if calculating many distances at once, but that isn't an issue for now. Regardless, the check should be fixed, IMO.
>>> timeit.timeit(stmt="RawDist(A, B)", setup="""
def RawDist(A, B):
return (
(A[0] - B[0]) ** 2 +
(A[1] - B[1]) ** 2 +
(A[2] - B[2]) ** 2
) ** 0.5
A = [100, 200, 300]
B = [-100, 300, 500]
""")
0.8861929820000114
>>> timeit.timeit(stmt="NumpDist(A, B)", setup="""
import numpy
import numpy.linalg
def NumpDist(A, B):
return (numpy.linalg.norm([A[i] - B[i] for i in range(len(A))]))
A = [100, 200, 300]
B = [-100, 300, 500]
""")
3.9713942719999977
from trade-dangerous.
Related Issues (20)
- Non-existent commodities appearing in the data HOT 1
- Fix github actions to not try to publish when none on the main branch HOT 1
- This looks like an FC but --FC N HOT 9
- Add --age functionality to 'trade buy' HOT 1
- Relocate importable files into their own folder HOT 1
- Executing a trade run after a database update gives an error. In my TD\data folder the Tradedangerous.prices file is not showing HOT 6
- Fix the need to generate prices - pretty please with sugar on top. HOT 16
- When I run the command "trade.py import -P eddblink -O all", I get error messages ! HOT 9
- A General List of Potential Issues
- Fix warnings in deploy HOT 4
- Server hosting upgrade HOT 53
- Locale changes break on systems with certain locales, in general unnecessary
- Looks like `--progress` no longer works HOT 1
- Function/command "Cmdr Profile" generates an error HOT 4
- The search for specific goods generates an error ! Function "buy" HOT 10
- Again a problem with the command/function "Cmdr Profile" HOT 5
- The Culling: What's deprecated/discontinued?
- Enable Discussions tab in Github?
- PadSize argument parser is explicitly only allowing one character HOT 3
- Duplicate Rescue Ship "HR 1183/Arc's Faith" HOT 1
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 trade-dangerous.