The Strait of Hormuz is closed — which, we know, is stopping oil exports.

But a lot of the world's fertilizer also comes from there.

How much? And which countries depend on it?

That's what we analyze, with #Python #Pandas, in the latest Bamboo Weekly!

Check it out: https://BambooWeekly.com

I'm tired of this #Pandas useless warning.

In what world do they think it's anything but annoying to warn people about one of the most common regular expression feature? Plus, using non-capturing groups is irrelevant to a simple match and would be more verbose.

Have a #Python #Pandas series with datetime values, and want all those until now? Compare with pd.Timestamp.now():

df.loc[ pd.col('when') < pd.Timestamp.now() ]

This returns the rows from df where the "when" column is before now.

Want to check whether a #Python #Pandas series contains another string? Use .str.contains:

df['x'].str.contains('a')

This returns a boolean series, whose index matches that of df.

Keep only those rows containing 'a':

df.loc[ pd.col('x').str.contains('a') ] # Pandas 3 syntax

Рейтинг языков программирования на GitHub: анализ 2024–2025 в JupyterLab и Anaconda

Мы не стали спорить с TIOBE и RedMonk и собрали свой рейтинг языков программирования на основе GitHub. Данные за 2024–2025 показывают неожиданные вещи: JavaScript впереди, TypeScript резко растёт, а Rust и Go выигрывают по качеству проектов. Разбираем, что стоит за цифрами и где могут быть искажения.

https://habr.com/ru/companies/hostkey/articles/1017990/

#Python #GitHub_API #JupyterLab #анализ_данных #визуализация_данных #pandas #рейтинг_языков_программирования #репозитории #Data_Engineering #hostkey

Рейтинг языков программирования на GitHub: анализ 2024–2025 в JupyterLab и Anaconda

Автор: Иван Богданов, Технический писатель  Каждый раз, когда выходит новый рейтинг языков программирования типа TIOBE или RedMonk , в комментариях начинается одно и то же. Python не может быть...

Хабр

Dinge, die mich davon abhalten, noch produktiver in meiner Arbeit zu sein:

- HTTP Error 503 einer gewissen API (mal wieder...)
- marodes Streckennetz der #Bahn
- dieser eine Spezialfall in #pandas, den ich schon wieder vergessen habe
- unbefugte Personen im Gleis
- #PyCharm "updating skeletons"/ "indexing"
- "Dieser Zug fährt heute nur bis Ahrensburg. Grund dafür sind Maßnahmen zur Stabilisierung des Betriebsablaufs."
- Windows macht ein Update

#Pendler #Python #Coding #Montagslaune 😂

Changing your clocks this weekend? Or did you do so a few weeks ago? Or maybe you never do?

In the latest Bamboo Weekly, we use #Python #Pandas to see which countries observe DST, and for how long each year.

Check it out: https://BambooWeekly.com

A #Python #Pandas column contains comma-separated values. How can you get the first of those?

First, break each string into a list:

df['x'].str.split(',')

Then use .str[0] to grab the first element from the resulting list:

df['x'].str.split(',').str[0]

Want to check whether a #Python #Pandas string series only contains digits? Use str.isdigit:

df['x'].str.isdigit()

This returns a boolean series, with df's index. You can then convert the digit-containing strings to integers:

df.loc[pd.col('x').str.isdigit(), 'x'].astype(int)

Want to retrieve a slice from a string column in your #Python #Pandas data frame? Use .str.slice:

df['a'].str.slice(1, 10) # or .str[1:10]
df['a'].str.slice(1, 10, 2) # or .str[1:10:2]
df['a'].str.slice(None, 10) # or .str[:10]
df['a'].str.slice(1, None) # or .str[1:]