question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Suggestion: vectorizing

See original GitHub issue

Your package is very helpful, thanks a lot 😄

Just thinking, maybe you can vectorize all the functions so they can be use on a numpy array or pandas DataFrame, it’ll be awesome for those who work with geo data

I know we can use .apply but why not vectorize 😉 ?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jannikmicommented, Jun 28, 2019

Maybe I am missing something, but from my point of view this is not possible or at least not beneficial. Each lat, lng coordinate pair represents their own query point and each of those point requires a separate procedure (independent from all others). This package does not really operate on the coordinates of the query points but rather the internal representation of the timezones. numpy functions are hence not useful in the use case you describe.

Please note that even numpy functions use for loops (this is not a bad thing) and this package already uses numpy functions internally to handle the timezone polygons.

Thanks for the suggestion, but I believe using the existing functions DataFrame.apply and numpy.vectorize already covers this use case best. I am closing this issue now. Feel free to comment if you are having doubts.

0reactions
phineas-ptacommented, Jun 28, 2019

I don’t know whether it’s possible with your code, I’m thinking about using numpy.array as the backend directly, and doing all the calculations with numpy functions

Read more comments on GitHub >

github_iconTop Results From Across the Web

Suggestion Vector Art, Icons, and Graphics for Free Download
Browse 1497 incredible Suggestion vectors, icons, clipart graphics, and backgrounds for royalty-free download from the creative contributors at Vecteezy!
Read more >
Suggestion Vector Images (over 10,000) - VectorStock
The best selection of Royalty Free Suggestion Vector Art, Graphics and Stock Illustrations. Download 10000+ Royalty Free Suggestion Vector Images.
Read more >
Vectorization Recommendations for C++ - Intel
Allocating separate arrays for each thread and then merging them after a parallel recommendation may improve speed (but consume more memory).
Read more >
A suggestion for Vectorizing | By Broadsided Press - Facebook
A suggestion for Vectorizing. Just a little way of saying "Happy National Poetry Month!" - with Debbie Nadolney and Amy Meissner.
Read more >
Getting Started with Text Vectorization | by Shirley Chen
In this project, we will learn how to implement text preprocessing and text vectorization, how to build a book recommendation system using ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found