Using pd.to_numeric
In [1079]: df[pd.to_numeric(df['id'], errors="coerce").notnull()]
Out[1079]:
id name
0 1 A
1 2 B
2 3 C
4 4 E
5 5 F
More Related Contents:
- how to calculation cost time [closed]
- Pandas: Adding new column to dataframe which is a copy of the index column
- pandas: filter rows of DataFrame with operator chaining
- Pandas groupby: How to get a union of strings
- How do I create test and train samples from one dataframe with pandas?
- pandas groupby sort within groups
- Applying function with multiple arguments to create a new pandas column
- Python Pandas max value in a group as a new column
- Convert columns to string in Pandas
- What is the difference between using loc and using just square brackets to filter for columns in Pandas/Python?
- Pandas: Cast column to string does not work
- How to query MultiIndex index columns values in pandas
- Python – splitting dataframe into multiple dataframes based on column values and naming them with those values [duplicate]
- Add multiple empty columns to pandas DataFrame
- No numeric types to aggregate – change in groupby() behaviour?
- OSError: Initializing from file failed on csv in Pandas
- Line plot with data points in pandas
- Python & Pandas: How to query if a list-type column contains something?
- Remove Unnamed columns in pandas dataframe [duplicate]
- Pandas: Reading Excel with merged cells
- Pandas groupby with categories with redundant nan
- Datetime conversion – How to extract the inferred format?
- Python numpy: cannot convert datetime64[ns] to datetime64[D] (to use with Numba)
- Slicing multiple ranges of columns in Pandas, by list of names
- What values are valid in Pandas ‘Freq’ tags?
- reading multiple files contained in a zip file with pandas
- How to filter a DataFrame column of lists for those that contain a certain item
- Excel VLOOKUP equivalent in pandas
- Seaborn multiple barplots
- pandas scatter plotting datetime