Should You Learn R or Python?

  • Comments posted to this topic are about the item Should You Learn R or Python?

  • I've not tried R but have worked a lot with Python.  I think the ease of use and flexibility of data handling structures within Python make it extremely attractive to data folk.

    AWS and Google allows Java, Python and Node.js as their primary languages for data technology.  Google also supports GO.

    AWS does allow custom languages and I believe that Rust is becoming increasingly popular.

    I've found that Python is a great "get things done" language.  I am more focussed on what I am actually trying to do rather than fighting the language.  I like the support for TDD with PyTest and BDD with the Behave framework.  Pylint and Flake8 are great for enforcing code quality rules and the "black" code formatter does help comply with that.

    Python3.10 is in beta with 3.11 in alpha.  3.11 has a goal of achieving a dramatic performance boost over preceding versions.  There are existing optimisation techniques that do help but are limited in scope.  Cython for example.

    The way I started my career  meant I never had the separation between what I would do as a developer and what I would do as a DB person.  For me mix and matching SQL and other languages to achieve an end is just the way it should be done.

    The Python SQLAlchemy library allowed me to interact with varying SQL sources with ease and consistency.

    The Pandas library is great for data handling though horribly memory inefficient.  Apache Spark is a fantastic piece of engineering.  Its support for the SQL language is incredible.

    Pyarrow is great for writing out parquet files and translating between columnar formats.  I wish parquet was an input/output option for bcp.

     

  • I've learned Python and done some with it. Because of SQL Server Central discussing both R and Python I've weighed which one to learn and use. Initially I was attracted to R since it appeared to be more geared towards research. However, as time went by, I saw Python gain in popularity, so I decided, when it came down to which to learn, I'd learn Python.

    One thing I don't like about the Python language is the adherence to indentation. It reminds me of FORTRAN, which I learned and wrote code in many years ago. It was always such a pain to program in FORTRAN - "make sure that your code starts in column 7...". The editors back then weren't very helpful. Today when I do write something in Python, I was Visual Studio Code, which handles it nicely.

    I confess that I don't use Python a lot. I don't even have it on my resume, as I'd hate to be asked a Python question in an interview.

    Python is an interesting language, apart from its insistence upon indentation to handle program structure. In my day job I write lots of C#, which I love. C# is my preferred language of choice. But like any programming language, if you only know one, then that's your hammer and all your problems look like nails. It's good to shake it up by learning a different programming language.

    Rod

  • I was introduced to R by a recommendation from someone who has a degree in statistics. He said he needed to use it in his course work.

    I have used it to create graphs. I learned enough to create the graphs I needed and not a lot more (and have forgotten most of it since).

    So it seems R is designed for statistical analysis and graphing more so than Python?

  • I started learning R when I began working on the Data Science professional program that used to be offered by Microsoft.  Students had their choice to chose R or Python for the language and I chose R because, at the time, it could be used in SQL Server and Visual Studio.

    From what I've read and seen, R still seems to be ahead of Python when it comes to creating charts and graphs--I'm a member of Kaggle and I've been blown away by some of the charts and graphs that I've seen written in R.

    I haven't executed R scripts within SQL Server itself, simply because it's faster to type everything in RStudio,  but I've connected and queried data to produce charts and graphs for my place of employment.  I really like that I can write the query in SSMS and then just copy it into my R script.

    I do look at Python code but I haven't done any programming in it.  One of these days I probably will but for now, I'm working on enhancing my knowledge on R.

  • If you are doing anything statistical then R is the one to go for.

    Python is a general purpose programming language. BASIC isn't dead, it's just called Python nowadays ;-).

  • I tried writing a linear regression function in Transact-SQL once. It was a lot of code - some of it necessarily dynamic. With R it is a single function - just supply the columns from the SQL result you want to correlate.

  • I'll add that while I thought R would be way better, a lot of the same modules and packages from R have been ported to Python, so I find the same things in both.

    I think Python is a great language, and I'd rather deal with indents than semicolons. Plus it's visually easier to see what's happening.

  • This was removed by the editor as SPAM

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply