Is Python a stable language?

I have been trying to learn Python, specifically with respect to applying K-Means Analysis to my data.

I found the following tutorial and copied the code into Jupyter notebook to run it.

I received three different errors, one of which I resolved (changed “size” to the revised “height” in the code.

The first warning was returned for two instances of the following code, one for a training set and the second for a test set.

Fill missing values with mean column values in the train set

train.fillna(train.mean(), inplace=True)

FutureWarning: Dropping of nuisance columns in DataFrame reductions (with ‘numeric_only=None’) is deprecated; in a future version this will raise TypeError. Select only valid columns before calling the reduction.
train.fillna(train.mean(), inplace=True)

The second was for multiple instances of slight variants of the following code:

TypeError Traceback (most recent call last)
Input In [44], in <cell line: 1>()
----> 1 KMeans(algorithm=‘auto’, copy_x=True, init=‘k-means++’, max_iter=600,
2 n_clusters=2, n_init=10, n_jobs=1, precompute_distances=‘auto’,
3 random_state=None, tol=0.0001, verbose=0)

TypeError: init() got an unexpected keyword argument ‘n_jobs’

My question is this, is it worth learning Python if code is going to become obsolete, with code no longer running over, in this case, four years?

Dear Rick_Walker

Thank you for your contribution to the anaconda community.
This is a very difficult question, but here are my answers.

My question is this, is it worth learning Python if code is going to become obsolete, with code no longer running over, in this case, four years?

The Python programming language was developed by Guido Van Rossum in 1991, Python 2.0 was released in 1997, and Python 3.0 was released in 2002.

In recent years, it has been widely used in the AI ​​and IoT fields, and many modules have been developed accordingly.

Regarding mutual interference and side effects between modules, it is not a system that someone centrally manages, but the situation is that each community is doing it.

Therefore, every time a new module is developed, there are some cases where side effects occur.

However, since Python modules consist of readable source scripts, anyone can improve them.

This means that you can also develop your own modules and project-specific modules.

If you are interested in them, it is good to learn. However, if you only use applications developed by vendors and suppliers, I don’t think you need to learn.

Best regards.

Thank you very much for taking the time to make your reply.

As a newbie to Python, I am finding it frustrating to find code for something I want to do, Cut and Paste it into Jupyter Notebook and have it return errors IO don’t know how to resolve. I guess it will be a case of practice making perfect. Once again, thank, you.

dear Rick_Walker.

thank you for your reply.

Experiment with lots of code and data. From there new discoveries are born. Google’s success and self-driving cars are also born from there.

I sincerely wish you every success.

Best regards.

So, there’s a lot of things to consider here. But mainly, a robust language is an actively updatede language. A language that is static and unchanging is one that is rapidly becoming obsolete and is not in active use. This applies to human languages as well, one of the features that makes English so popular globally is that it changes, updates and adapts so rapidly.

There are definitely downsides to this. As you note, function syntax and inputs may change. Typically there’s plenty of notice if you are using a particular package regularly, but if you use it infrequently you may be out of the loop. Also, that means that information and sample code on the web may be out of date quickly and cutting and pasting that code will frequently not work. But it’s better than the alternative, it just may mean that you haven’t been used to using a modular, modern, popular language.

The result is that package management is extremely important. Best practice, when developing code, is to create a dedicated environment with known and documented versions of packages, and be aware that updating or changing package versions can change or break things. If you maintain a known good environment, then you can always roll back to that.

Also, you’ll learn (or it seems like you already have!) that google results for code samples can be suspect, out-of-date, and wrong. There’s so much bad advice on fixing python code and IDEs out there. I commonly see advice to “just run pip install <package a>'” without any thoughts to what the effects of installing things through conda and pip may do (spoiler: not good things).

On the other hand, lots of really cool things get added all the time. We do a fair amount of machine learning and AI here with gpu processing on NVIDIA cards using CUDA. In the past, this involved installing a combination of the compatible versions of Tensorflow, C compiler, cuDNN and CUDA toolkit. But now, NVIDIA has released versions of the CUDA toolkit and cuDNN into the conda repositories and Tensorflow has a gpu version (Tensorflow-gpu, naturally), which allows everything to install seamlessly together just using dependency checking in conda! (You still need to make sure you have an appropriate graphics driver). It’s just worlds better, but if you google how to set it up, almost every result you’ll find will make no mention of the new packages and availability.