Skip to content

Instantly share code, notes, and snippets.

@cereniyim
Created May 21, 2020 17:34
Show Gist options
  • Save cereniyim/506d3d97ec98723fd702041f2f0c3536 to your computer and use it in GitHub Desktop.
Save cereniyim/506d3d97ec98723fd702041f2f0c3536 to your computer and use it in GitHub Desktop.
function to convert features dataframe to array
def convert_features_to_array(features):
# function to convert feature df
# to an array
num_rows = len(features)
num_cols = len(features.columns)
features_array = (np
.array(features)
.reshape((num_rows,
num_cols)))
return features_array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment