You can convert to string and extract the integer using regular expressions.
df['B'].str.extract('(\d+)').astype(int)
More Related Contents:
- How to add a new column to an existing DataFrame?
- How to change the order of DataFrame columns?
- Add missing dates to pandas dataframe
- Python Pandas – Find difference between two data frames
- Pandas: sum DataFrame rows for given columns
- pandas: filter rows of DataFrame with operator chaining
- Rename Pandas DataFrame Index
- Pandas DataFrame: replace all values in a column, based on condition
- What is the fastest way to upload a big csv file in notebook to work with python pandas?
- How to check if any value is NaN in a Pandas DataFrame
- Python Pandas max value in a group as a new column
- Convert row to column header for Pandas DataFrame,
- Select multiple ranges of columns in Pandas DataFrame
- pandas – filter dataframe by another dataframe by row elements
- Python Pandas replicate rows in dataframe
- Efficiently replace values from a column to another column Pandas DataFrame
- Left justify string values in a pandas DataFrame
- Copying MultiIndex dataframes with pd.read_clipboard?
- Can’t drop NAN with dropna in pandas
- Override global variable inside function not working with Spyder 4
- Putting many python pandas dataframes to one excel worksheet
- Remove Unnamed columns in pandas dataframe [duplicate]
- Find difference between two data frames
- Create new column based on values from other columns / apply a function of multiple columns, row-wise in Pandas
- append dictionary to data frame
- Efficient way to add rows to dataframe
- Find names of top-n highest-value columns in each pandas dataframe row
- Calculate summary statistics of columns in dataframe
- Python: Adding hours to pandas timestamp
- Pandas: Join dataframe with condition