Go Premium for a chance to win a PS4. Enter to Win

x

Python

Python is a widely used general-purpose, high-level programming language. Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than would be possible in other languages. Python supports multiple programming paradigms, including object-oriented, imperative and functional programming or procedural styles. It features a dynamic type system and automatic memory management and has a large and comprehensive set of standard libraries, including NumPy, SciPy, Django, PyQuery, and PyLibrary.

Share tech news, updates, or what's on your mind.

Sign up to Post

Subject of the week | Tell us about a technology you'd like to learn.
I'm fascinated by developments in Machine Learning and want to, heh, learn more about it. Not so much because I want to create Machine Learning systems myself—I have very little interest in the math involved—but so I can know how to leverage the sort of things that are being built. I easily envision the future of most work being about managing various bots and knowing how to apply them to higher level problem solving.

To get started on that path, I'm currently teaching myself Python (via several books on the subject) and would then transition into the use of it to dig deeper into the Machine Learning libraries. (And if I have to, even some refresher on the math... I did pass the AP calculus test, but that was 20 years ago!)

Any of you out there with more knowledge in these areas have some advice on this?
1
Free Tool: Site Down Detector
LVL 11
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

USB GPS Detection on Raspberry PI

I have some python code that scans WIFI packets and in my receiver code I have an instance of a GPSPoller class.

The issue I am having is that withing the gps library gpscommon.read() blocks when there is no GPS dongle connected to the Pi.

I couldn't seem to find an elegant way to check to see if gpds has any devices added to its device pool so I could skip my code that starts polling gpsd for position data.

I don't want to write code to check for /dev/ttyUSB0 as that does not seem like a very elegant solution.

Can anyone provide advice?
0
 

Author Comment

by:spencerturbine
lsusb would list my device but then I would have to write software that looks for the specific device. If I swapped out the receiver for a different kind I would have to change the code to take that into account.

I hope there is a better way to do it that lsusb.
0
 

Expert Comment

by:Mark Wieder
Yeah, if you want the code to be more generic (how often do you intend to swap out a different gps dongle?) then lsusb probably won't help here. You might try setting up a socket connection to port 2947 and trap the error, but you'll have to do this before instantiating the gps class because the class initializer does that as well.
0
I just recently picked up the Humble Bundle for several Python programming eBooks. Great set of books for a really low price; can even get the basic set for as low as $1! If you've ever been thinking of learning Python, this is a pretty unbeatable deal. (I even already had a hard copy of Automate the Boring Stuff with Python but getting the eBook version as well is extra nice.)

Act fast though, less than four days to go for this deal!

(And no, I'm not even trying to get a referral bonus on this, I just think it's an awesome offer you should check out! Although, as you learn Python, I'd certainly love to have you participating in Expert Exchange to get support from the community as you run into problems or to share your accomplishments ;-)

Happy learning!

https://www.humblebundle.com/books/python-book-bundle
3
I've been really interested in recommendation systems lately which has lead my down a few rabbit holes. One of these landed on a similarity measurement called Jaccard similarity which is a fairly straightforward metric for communicating how many elements two sets have in common.

This turns out to be very difficult to compute without some tricks but can be estimated with a certain degree of confidence using minHashing. If this sort of thing interests you I would check out this blog post by Chris McCormick - its one of the best explanations I came across (even though its in the context of document similarity). There is even some python code provided.

I would summarize the technique in one sentence as: by randomly shuffling the union of two sets and looking at the first element in the new, shuffled set, the probability that it is an item belonging to their intersection is equal to the Jaccard Similarity.

http://mccormickml.com/2015/06/12/minhash-tutorial-with-python-code/
5

Python

Python is a widely used general-purpose, high-level programming language. Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than would be possible in other languages. Python supports multiple programming paradigms, including object-oriented, imperative and functional programming or procedural styles. It features a dynamic type system and automatic memory management and has a large and comprehensive set of standard libraries, including NumPy, SciPy, Django, PyQuery, and PyLibrary.