datapythonista – Telegram
datapythonista
218 subscribers
69 photos
1 video
22 links
Data, Python, Free Software and Memes
Download Telegram
Channel created
A short introduction to versions. This convention is widely used in Python, but not always, and not limited

The version as 3 numbers, separated by periods: <major>.<minor>.<release>. For example: 3.1.2.

- 0.1.0: A first value (named major) 0 shows that the software is still not considered mature, and also big changes can happen to the API, that could possibly break our code. The use of the two other values will be used in a not standardized way.
- 1.0.0: Reaching the version 1 means that the software is considered mature for production use (even if in many cases very mature software use a 0 major for years), and that the convention below will start to be used
- 1.0.1: The increase in the last number (named release) shows that bugs were fixed, and nothing was added (like new features). As a user, you should also use the latest release available for your version.
- 1.1.0: The increase in the middle number (named minor) means that this new version contains new features, not only bug fixes, but that code working in an older version of the same major, should still work.
- 2.0.0: The increase in the major, means that new features have been implemented, possibly with major changes or additions. But that code of older majors may break. Before updating to a major, you should update to the immediate version before, and make sure you address any FutureWarning or DeprecationWarning in your code.

Versions can have suffix such as:
- pre: for a release candidate, to let users try it and report possible errors before the release
- post: to fix errors in a release not affecting the code
- dev: usually for unreleased code, and after dev it's included the last commit in the repository

The full Python standard for versioning is: https://www.python.org/dev/peps/pep-0440/
😁2
👍1
Some notes on Python package managers:

- pip works fine for Python dependencies, but if you have a package that depends on a C library, pip will fail with a not so useful error, and you will have to go to your OS package manager (apt-get, brew...) and find and install the missing package before you run pip again.

- Also pip does not allow to install different Python versions.

- conda was created by Anaconda to address the first issue. With it's own repository of packages, and then conda-forge was created as a community maintained repository of packages, making the original Anaconda repository obsolete for most cases.

- As the number of packages grew, the conda solver became slower, and for the last years, a simple conda install command can take forever. Conda seems mostly unusable today.

- Mamba is a wrapper around conda, using the same command line options, with several performance improvings. The main one is a totally different solver which seems to be immediate in most cases.

- For simple environments pip and virtualenv is a good choice, since it's disk requirements are much smaller than conda or mamba. For environments with specific Python versions, or non-Python dependencies, mamba is the best approach. I'm not aware of any use case where I'd recommend conda.

To install mamba use mambaforge: https://github.com/conda-forge/miniforge#mambaforge
In-person Python conferences are back. Still some uncertainty, and not all them confirmed, but those are on the works:

- PyCon DE / PyData Berlin, April 11, Berlin

- PyCon US, April 27, Salt Lake City

- @europython, July 11, Dublin

- @euroscipy, beginning of September, Basel, unconfirmed

- @scipyla, September 26, Salta
👍1
Same with pandas... 😅
😁2
For several years it's been possible to have a Python terminal in the browser. pythonanywhere.com was probably among the first to provide this. More recently, mybinder.org offered a full Jupyter experience without the need to install anything locally. All these technologies had a JavaScript terminal in the browser, and a backend able to run Python code, that was costly to host.

Just few days ago it was announced a new paradigm to the game: JupyterLite. A JavaScript terminal, powered by WebAssembly (using Pyodide). The idea is similar for the terminal, but there is no need for a backend, since Python is executed in the client browser using WebAssembly. You can deploy a 100% static site, and your users will be able to execute Python code. It also can provide complex dependencies like numpy and pandas.

You can read more in this blog post: https://blog.jupyter.org/jupyter-everywhere-f8151c2cc6e8 and you can try it in numpy.org. It takes a while to execute the first cell, while it needs to download and load all files internally required, but after that wait, it's fast and seems to work quite nicely.
🔥2👍1
If reading programming books was just as effective....
👍2😁1
A short list of movie classics about free software, computers and data:

2001: A Space Odyssey (1968)

TRON (1982)

WarGames (1983)

The Matrix (1999)

Pirates of Silicon Valley (1999)

Revolution OS (2001)

Antitrust (2001)

The Code (2001)

CitizenFour (2014)

The Imitation Game (2014)

More suggestions? Add a comment.
🔥1
Thanks Linus and team for 17 years of amazing version control
🎉7
Sometimes bash can be a pretty decent analytics tool. For example, this oneliner command outputs the top 10 pandas contributors in 2018 based on the git log:


$ git log --pretty=format:%ci,%an | grep "^2018-" | cut -d"," -f2 | sort | uniq -c | sort -nr | head -n10
    346 jbrockmendel
    216 Tom Augspurger
    103 gfyoung
     99 Joris Van den Bossche
     96 Jeff Reback
     89 Matthew Roeschke
     78 Marc Garcia
     62 William Ayd
     51 topper-123
     50 h-vetinari
🔥3👏3👍1
Seems like the most popular topic at PyCon US is PyScript, a WebAssembly framework to be able to use Python in HTML, as it's commonly done in JS using <noscript> tags. You can see a hello world example here.

Personally, I don't see the value of trying to use Python for everything. Python is an amazing technology for many use cases. But there are many other applications that could better be done with other languages, in this case JavaScript.

Some other examples are Cython, a brilliant technology to transpile Python-like code to C, and compile it. But therr are probably better languages to do that. Another example is MyPy, to bring type annotations and validation to a previously dynamically typed language like Python. Making the syntax probably too complex for the value it adds. And there are many other examples.

I wonder if it'd make more sense to use Rust, Julia, Go, Lua... for many of these use cases Python is trying to conquer. And focus on making Python better for what it was good initially (adding multithreading, better packaging, smarter handling of single type lists, just in time compiling...).
👍5
Interesting benchmark on array computing in the browser: https://jott.live/markdown/wasm_vector_addition
👏4
One of the most interesting talks I watched in a long time. About the imminent financial collapse, the nonsense of how the software industry works, how both are connected, and what as a software professional (in particular a manager) you can do about it.

Be ready for 1h20m of bad news. 😉

https://m.youtube.com/watch?v=oWSEb0_2hb0