I would like to perform following operation in Pandas:
library(tidyverse)
df <- tibble(mtcars)
df %>%
select(ends_with('t')) %>%
head(3)
# Accross all columns that ends with t, add value 100 hundred (+1 for true) if column contains 'at
df %>%
mutate(across(ends_with('t'), ~ . + 100 + str_detect(cur_column(), 'at'))) %>%
select(ends_with('t') )%>%
head(3) %>% view()
Is there any nice equivalent to it? Or at least some really nice one-liner using apply
function in pandas?