Skip to content

Instantly share code, notes, and snippets.

@AI-MOO
Last active February 27, 2022 21:29
Show Gist options
  • Save AI-MOO/b267d4115bd1dcca5b217578bdb9048c to your computer and use it in GitHub Desktop.
Save AI-MOO/b267d4115bd1dcca5b217578bdb9048c to your computer and use it in GitHub Desktop.
# التحقق من القيم الممثلة لكل ميزة وتحديد نوع الميزة [فئوية ، رقمية متصلة]
categorical_val = []
continous_val = []
for column in df.columns:
print('==============================')
print(f"{column} : {df[column].unique()}")
if len(df[column].unique()) <= 10:
categorical_val.append(column)
else:
continous_val.append(column)
print('==============================')
print(f"Categorical Features : {categorical_val}")
print(f"Continous Features : {continous_val}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment