You can do this efficiently with combining calendar.month_abbr
and df[col].apply()
import calendar
df['Month'] = df['Month'].apply(lambda x: calendar.month_abbr[x])
More Related Contents:
- Add missing dates to pandas dataframe
- Can pandas automatically read dates from a CSV file?
- python/pandas: convert month int to month name
- Sort a pandas dataframe series by month name
- Extracting dates that are in different formats using regex and sorting them – pandas
- How to iterate over rows in a DataFrame in Pandas
- Difference between map, applymap and apply methods in Pandas
- Pandas filtering for multiple substrings in series
- Python pandas insert list into a cell
- How to replace text in a string column of a Pandas dataframe?
- Combine two pandas Data Frames (join on a common column)
- Pandas DataFrame Groupby two columns and get counts
- Pandas dataframe get first row of each group
- pandas .at versus .loc
- Running get_dummies on several DataFrame columns?
- Selection with .loc in python
- How to flatten a hierarchical index in columns
- Add column to dataframe with constant value
- Pandas get the most frequent values of a column
- Subtract two columns in dataframe
- Python / Pandas – GUI for viewing a DataFrame or Matrix [closed]
- How to do “(df1 & not df2)” dataframe merge in pandas?
- Add a sequential counter column on groups to a pandas dataframe
- How do I assign values based on multiple conditions for existing columns?
- Check if rows in one dataframe exist in another dataframe
- Pretty print a pandas dataframe in VS Code
- Pandas – Interleave / Zip two DataFrames by row
- Pandas custom function to find whether it is the 1st, 2nd etc Monday, Tuesday, etc – all suggestions welcome
- pandas extract year from datetime: df[‘year’] = df[‘date’].year is not working
- pandas.read_csv FileNotFoundError: File b’\xe2\x80\xaa’ despite correct path