Useful pandas commands

Sep 27, 2023 11:10


df.sub(1).abs().lt(0.05).idxmax()
df.groupby('od1').groups
df['a'].floordiv(10)
df['a'].mod(10)
df.A.str.extract('(.*)\s+ is apply')
df['season'] = ((df.index.month % 12 + 3).map({'1':'winter', '2':'spring', '3':'summar', '4':'fall'})
Previous post Next post
Up