I'm a bit drunk but...
- presdifffromparty = presperformance - partyprecinctperf // y = n - x
- precinctinfo['precinctrep'] = partyprecinctperf // x
...
- jsondict['x'] = precinctinfo['precinctrep'] // x
- jsondict['y'] = presdifffromparty // y
Looks like the same problem.
Instead try...
- jsondict['y'] = presperformance
I could probably give some indentation / whitespace and naming advice but not really critical.
Just stuff like...
- [ precinct.get('precinct')]
Should be...
- [precinct.get('precinct')]
And a lot of inconsistency. I usually set my IDE to show white space and tabs. It looks as though at least two people worked on this or parts were copies in or multiple editors were used. I see double spaces, then quad spaces, then tabs.
Consider using _ to separate words in variable names. For example bunchofwordssquashedtogether is not particularly easy on the eye.
I'll look at it closer tomorrow to understand exactly what these colums are and how to properly put them to use (full define them so I know exactly how they relate to what's on ballot, maybe dig around for a ballot image too). Saying that it looks like individual names so it's a bit different. I guess the concept of straight R is in the code. Names don't have party but I can google it. I'll probably just plot all the candidates performance first.
Note that this data is limited you may not be able to detect fraud with it even if these is fraud.
I'm a bit drunk but...
- presdifffromparty = presperformance - partyprecinctperf // y = n - x
- precinctinfo['precinctrep'] = partyprecinctperf // x
...
- jsondict['x'] = precinctinfo['precinctrep'] // x
- jsondict['y'] = presdifffromparty // y
Looks like the same problem.
Instead try...
- jsondict['y'] = presperformance
I could probably give some indentation / whitespace and naming advice but not really critical.
Just stuff like...
- [ precinct.get('precinct')]
Should be...
- [precinct.get('precinct')]
And a lot of inconsistency. I usually set my IDE to show white space and tabs. It looks as though at least two people worked on this or parts were copies in or multiple editors were used. I see double spaces, then quad spaces, then tabs.
Consider using _ to separate words in variable names. For example bunchofwordssquashedtogether is not particularly easy on the eye.
I'll look at it closer tomorrow to understand exactly what these colums are and how to properly put them to use (full define them so I know exactly how they relate to what's on ballot, maybe dig around for a ballot image too). Saying that it looks like individual names so it's a bit different. I guess the concept of straight R is in the code. Names don't have party but I can google it. I'll probably just plot all the candidates performance first.
I'm a bit drunk but...
- presdifffromparty = presperformance - partyprecinctperf // y = n - x
- precinctinfo['precinctrep'] = partyprecinctperf // x
...
- jsondict['x'] = precinctinfo['precinctrep'] // x
- jsondict['y'] = presdifffromparty // y
Looks like the same problem.
Instead try...
- jsondict['y'] = presperformance
I could probably give some indentation / whitespace and naming advice but not really critical.
Just stuff like...
- [ precinct.get('precinct')]
Should be...
- [precinct.get('precinct')]
And a lot of inconsistency. I usually set my IDE to show white space and tabs. It looks as though at least two people worked on this or parts were copies in or multiple editors were used. I see double spaces, then quad spaces, then tabs.
Consider using _ to separate words in variable names. For example bunchofwordssquashedtogether is not particularly easy on the eye.
I'll look at it closer tomorrow to understand exactly what these colums are and how to properly put them to use (full define them so I know exactly how they relate to what's on ballot, maybe dig around for a ballot image too). Saying that it looks like individual names so it's a bit different. I guess the concept of straight R is in the code. Names don't have party but I can google it.
I'm a bit drunk but...
- presdifffromparty = presperformance - partyprecinctperf // y = n - x
- precinctinfo['precinctrep'] = partyprecinctperf // x
...
- jsondict['x'] = precinctinfo['precinctrep'] // x
- jsondict['y'] = presdifffromparty // y
Looks like the same problem.
Instead try...
- jsondict['y'] = presperformance
I could probably give some indentation / whitespace and naming advice but not really critical.
Just stuff like...
- [ precinct.get('precinct')]
Should be...
- [precinct.get('precinct')]
And a lot of inconsistency. I usually set my IDE to show white space and tabs. It looks as though at least two people worked on this or parts were copies in or multiple editors were used. I see double spaces, then quad spaces, then tabs.
Consider using _ to separate words in variable names. For example bunchofwordssquashedtogether is not particularly easy on the eye.
I'll look at it closer tomorrow to understand exactly what these colums are and how to properly put them to use (full define them so I know exactly how they relate to what's on ballot, maybe dig around for a ballot image too).
I'm a bit drunk but...
- presdifffromparty = presperformance - partyprecinctperf // y = n - x
- precinctinfo['precinctrep'] = partyprecinctperf // x
...
- jsondict['x'] = precinctinfo['precinctrep'] // x
- jsondict['y'] = presdifffromparty // y
Looks like the same problem.
Instead try...
- jsondict['y'] = presperformance
I could probably give some indentation / whitespace and naming advice but not really critical.
Just stuff like...
- [ precinct.get('precinct')]
Should be...
- [precinct.get('precinct')]
And a lot of inconsistency. I usually set my IDE to show white space and tabs. It looks as though at least two people worked on this or parts were copies in or multiple editors were used. I see double spaces, then quad spaces, then tabs.
Consider using _ to separate words in variable names. For example bunchofwordssquashedtogether is not particularly easy on the eye.