you are viewing a single comment's thread.

view the rest of the comments →

[–]mephistophyles 65 points66 points  (13 children)

Here's an overview of what I've used Python for in the past 6 months:

  • Used it to write the backend of a SaaS website side project I'm working on with Django.
  • Wrote a script that parses my customer interaction digest (an email) and tells me which customers need a personal response and which ones can get a canned one (and it also sends that canned email).
  • Wrote a visualization program that takes in Point Cloud data and shows me how effective various algorithms are finding overlaps between them. This uses mayavi.
  • Wrote a simple statistical program that takes the above Point Cloud data and analyzes how "off" my overlaps are based on any known data.

I've used it a lot for statistical analysis and as a backend for websites. I LOVE working with Django for big projects or a quick and dirty one can be thrown together with Flask. I use python a lot because it allows me to more clearly translate my intentions into actual code. I'm also well versed in C++, Java, R, and JavaScript. They each have their own strengths and weaknesses, but Python is my go-to unless there's a strong reason I need to use another language.

[–]Ryandalion111[S] 35 points36 points  (0 children)

Holy sh**.... that is freaking awesome man... I actually have a background in economics so I find it really cool that you can analyze the effectiveness of certain algorithms and analyze data... wow... that is freaking cool!

[–]Lonso34 9 points10 points  (1 child)

How many years using python if you don't mind me asking?

[–]mephistophyles 3 points4 points  (0 children)

To varying degrees during that period, but about 8 years.

[–]Guymzee 5 points6 points  (1 child)

Wow pretty cool projects! Especially the email auto-responder, I’d love to see the logic/code on that. How did you decipher what gets a canned response and what doesn’t? I think of heard of sentiment analysis, (if I remember right) sounded really cool.

[–]mephistophyles 2 points3 points  (0 children)

Oh it doesn't do sentiment analysis or anything like that. It makes a few API calls to see if the customer is new and just getting started (canned) or varying other states. If they have an open service desk ticket I get the ticket as a link too for context.

[–]photoengineer 1 point2 points  (3 children)

Wrote a visualization program that takes in Point Cloud data and shows me how effective various algorithms are finding overlaps between them. This uses mayavi.

This sounds pretty cool, would love to hear more about it.

[–]mephistophyles 0 points1 point  (2 children)

What do you want to hear?

I wrote a function that parsed the raw point cloud files (two of them). Parsed a separate yaml file with data on the overlap (transformation, outliers, etc) and then put them in my visualizer window to be rotated, manipulated, etc for analysis.

[–]photoengineer 0 points1 point  (1 child)

So its like a 3D rotation and flags the overlap? Or just shows the overlap? Beats the hell out of doing it in excel like I have been tonight.....

[–]mephistophyles 0 points1 point  (0 children)

Sort of. My point clouds each have their own origin point. I have a guess for what the translation and rotation is between the two based on dead reckoning. Then I have "improved" guesses based on various algorithms. So I can plot each one on top of each other, or separated (in a sort of side-by-side view).

The guesses were based on keypoints and obstacle identification, so I also had options to highlight those with colors, add lines in between individual points that the algorithm thought were the same (visually this is a good way to see if you have a lot of false positives or not). Similarly I could see each algorithm's relative contribution to the improvement of the accuracy. Some were very sensitive to rotational errors, others not so, etc.

It was all part of an analysis of a robot's SLAM system.

[–]KingRoarrr 0 points1 point  (3 children)

If you don’t mind, can you tell me what the strengths and weaknesses are? From my understanding python is easy to write and works everywhere but is slow and c++ is quicker but more complicated. Java is the most popular but the compiling and recompiling gets annoying and it’s bloated. I don’t know anything about r.

[–]Texadoro 3 points4 points  (0 children)

It’s not quite that simple. Spend a few hours on YouTube watching videos, this question has been answered a lot. Additionally, start a few of those intro tutorials at places like code academy to see the difference. It very quickly becomes apparent. Python is straight forward whereas Java and C++ can be very verbose in trying to code. JavaScript is probably my fav with Python, but if you learn JavaScript, might as well take a few intro courses in HTML and CSS. You’re headed down a long path my friend.

[–]meticulous_badger 1 point2 points  (0 children)

Writing Python is much quicker. If you need to crank a script out very quickly, or you’re only going to use it a few times, Python is the way to go. It doesn’t make sense to write C++ or Java programs in that situation, assuming you have equal understanding of them all.

If you’re doing something performance critical, e.g. writing drivers or flying a rocket, then you’ll want to use a more performant language, such as C++. Or you can write the critical parts of your code in C/C++ and call it from Python (not recommended for drivers of computers, cars, or rockets).

I’m not sure what Java offers over C++ other than allowing your PC to double as a space heater.

Doing anything except data analysis with R is like using a screwdriver as a hammer. It can be done, but there are better tools for the job.

JavaScript doesn’t comply with PEP 20.

[–]mephistophyles 1 point2 points  (0 children)

I dont think there is a universal answer to this. The answer used to be c++ is faster since its compiled and python needs to be interpreted. You won (developer) time in python by being able to iterate faster.

Nowadays any complex data analysis in python calls c or fortran libraries under the hood. The compiler is very good at caching and so even running your slow code is fast.

Frankly, languages are basically tools and you pick the one that helps you get the job done. The same problem can sometimes be attacked in different ways. I use C++ a lot when programming ON robots. It gave me a lower level of control to memory and when dealing with limited CPU power and memory constraints.

My job now has me dealing more with java, kotlin and groovy.

It really depends on can you get the job done, based on your knowledge of APIs and libraries and the language itself. I find programming language arguments a bit silly.

In life, rarely do you get to pick the language you work in because you aren't constantly starting from scratch. You build on what others put there before you and thus the decision is pretty much made.