# Separate discrete and continuous variables

I know how to separate numerical and categorical data as follows:

num_data = [cname for cname in df.columns if df[cname].dtypes == 'object']
cat_data = [cname for cname in df.columns if df[cname].dtypes in ['int64', 'float64']]


Now I want to separate my numerical variables into discrete and continuous. How do I do that?

• How do you define discrete and continuous variables? // Since you have discrete observations, there is an argument that all of your variables are discrete.
– Dave
Jan 8 at 7:25
• Discrete as in 1.0, 2.0, 5.0, 111.0 and so on. Continuous as in 1.1, 1.199, 444.34 and so on. Jan 8 at 9:49
• Wouldn‘t be a int column „discrete“ and „continuous“ float? Jan 8 at 11:24
• In my case, 1.0 is a discrete variable and float at the same time. Jan 8 at 11:36
• How to test if my data is discrete or continuous? Jan 8 at 12:04