Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

numerical columns

import pandas as pd
from pandas.api.types import is_string_dtype
from pandas.api.types import is_numeric_dtype

df = pd.DataFrame({'A': ['a', 'b', 'c'], 'B': [1.0, 2.0, 3.0]})

is_string_dtype(df['A'])
>>>> True

is_numeric_dtype(df['B'])
>>>> True
Comment

PREVIOUS NEXT
Code Example
Python :: login() takes 1 positional argument but 2 were given 
Python :: python this module 
Python :: difference_update() Function of sets in python 
Python :: how to check if a function is callable in puyjom 
Python :: Shallow copy in python and adding another array to list 
Python :: python Write a program to reverse an array or string 
Python :: keep 0 in front of number pandas read csv 
Python :: python if modulo 
Python :: os scan dir python 2 
Python :: print backward number 
Python :: Common elements in a list(comparing two lists.) 
Python :: python backtest 
Python :: set_debug 
Python :: ValueError: minvalue must be less than or equal to maxvalue 
Python :: rename all files in a folder and subfolder 
Python :: python is not operator 
Python :: emi calculator python code 
Python :: python using type and name advanced 
Python :: Source code: Matrix Addition using Nested Loop 
Python :: convert python code to dart online 
Python :: python polyfit with errors 
Python :: pyfiglet not coming up cmd 
Python :: oauthlib python error 
Python :: RuntimeError: input must have 3 dimensions, got 4 site:stackoverflow.com 
Python :: no lapack/blas resources found scipy 
Python :: python xlrd date 
Python :: open weather get local time python 
Python :: Python Modifying Global Variable From Inside the Function 
Python :: Python Printing negative timedelta object 
Python :: send2trash 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =