Use dt.day_of_week to get the day number from a #Python #Pandas datetime series.

But is 0 Sunday or Monday? Or not used at all?

Better: Use the day_name method:

df['x'].dt.day_name()

Good news: It returns a series of strings!
Bad news: It's 4x slower.

Метрики упали в лужу

Метрики могут «упасть» даже если вы ничего не меняли в модели. Разбираемся, как распознать distribution shift и что с ним делать в продакшене.

https://habr.com/ru/articles/1024380/

#eda #анализ_данных #мониторинг #статистика #предобработка_данных #pandas #data_science #machine_learning #data_analysis #production

Метрики упали в лужу

Нередкая ситуация, когда ваша модель спокойно себе крутится в проме, но внезапно прибегают аналитики с криками «у нас упало качество, посмотрите что может быть не так». Причин может быть множество, но...

Хабр

Do Americans pay more taxes than in other countries? Do they pay more in income taxes?

Explore OECD data with #Python, #Pandas, Marimo, and Claude Code (plus the new marimo-pair skill) in the latest Bamboo Weekly, and find out!

Read all about it: https://BambooWeekly.com

Want to grab a part of datetime value in a #Python #Pandas data frame column? Use "dt":

df['x'].dt.year
df['x'].dt.hour
df['x'].dt.minute
df['x'].dt.day_of_week # or dayofweek or weekday

day_of_week returns an integer, where 0 is Monday and 6 is Sunday.

🎵 Data analysis with Python using the most streamed Spotify songs dataset.
Loaded the CSV file, cleaned nulls and duplicates, dropped columns from other platforms, and built visualizations with matplotlib and seaborn: songs by year, explicit vs non-explicit content, and the song with the most streams.

There's a curious finding at the end. ↓

https://dev.to/nuriadevs/data-analysis-with-python-spotify-songs-dataset-3n4p

#python #datascience #pandas #spotify #opendata #developer

Data Analysis with Python: Spotify Songs Dataset

Data Analysis with Python: Spotify Songs Dataset Within the field of data science, loading...

DEV Community

It's tax day in the US — and according to Gallup, Americans think taxes are too high. But... how high are they vs. other countries?

In the latest Bamboo Weekly, I pose 6 questions about taxes. Can you solve them with marimo-pair, Marimo, Claude Code, and #Python #Pandas?

Check it out: https://BambooWeekly.com

Reading a CSV into #Python #Pandas, and parse_dates doesn't recognize the format? Pass the date_format keyword arg:

df = pd.read_csv(filename,
parse_dates=['x', 'y'],
date_format='%Y-%m-%d %H:%M:%S')

All strftime codes work!

Reading a CSV into #Python #Pandas, and want a column to be treated as datetime values? Use parse_dates:

df = pd.read_csv(filename,
parse_dates=['x', 'y'])

Bonus: The PyArrow engine often (not always) parses columns that look like dates.

Want to take a #Python #Pandas series of strings, and get datetime values? Use pd.to_datetime:

pd.to_datetime(df['x'])

Notice: It's not a method! It's a top-level pd function.

Specify a non-standard "format" with a strftime string:

pd.to_datetime(df['x'], format='%d/%m/%Y')

Artemis II is nearly over — but there's still time to solve six data-analysis problems about Orion's location and speed with #Python and #Pandas!

New data challenges every Wednesday. Solutions every Thursday.

Learn more: https://BambooWeekly.com