dssg / dssg/police-eis

Clean run_models.py

Open
#224 0 comments 0 reactions 1 assignee Claimed by @k1aus View on GitHub
enhancement
Dominant language
Python
Stars
56
Forks
19
PR merge metrics
No merged PRs in 30d

Description

I am just pasting two pending review request from **PR** #223

(**NOTE**: Both requests are for `run_models.py` lines `457-460`)

1. I think is a better idea not to hard code the number of individual features, maybe we chould add this as an argument to the method, so, the code will be:

```
result = pd.DataFrame(columns=['risk_%i'%i for i in range(1, num_of_individual_features + 1)])
```
2. You don't need to concatenate (is not the recommended way of doing this), you could create a list of tuples and then creating the pandas `DataFrame` (and you could remove the previous comment... but this needs more careful thinking, so you could leave this code here in this version.

For reference see: https://stackoverflow.com/questions/28056171/how-to-build-and-fill-pandas-dataframe-from-for-loop

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.