stijgers2json.py
This commit is contained in:
@@ -58,6 +58,7 @@ def corpus_stats(word, counts_recent, counts_reference, total_recent, total_refe
|
||||
|
||||
oudfile = sys.argv[1]
|
||||
nieuwfile = sys.argv[2]
|
||||
textfile = sys.argv[3]
|
||||
|
||||
counts_recent = {}
|
||||
counts_reference = {}
|
||||
@@ -95,7 +96,9 @@ for r, p_adj in zip(results, p_adjusted):
|
||||
|
||||
results = pd.DataFrame(results)
|
||||
|
||||
print("STIJGERS")
|
||||
print(results[results.pct_diff > 0].sort_values('g2', ascending=False)[:40].to_string())
|
||||
print("\nDALERS")
|
||||
print(results[results.pct_diff < 0].sort_values('g2', ascending=False)[:40].to_string())
|
||||
with open(textfile, "wt", encoding="utf-8") as fp:
|
||||
fp.write("STIJGERS\n")
|
||||
fp.write(results[results.pct_diff > 0].sort_values('g2', ascending=False)[:40].to_string())
|
||||
fp.write("\n\nDALERS\n")
|
||||
fp.write(results[results.pct_diff < 0].sort_values('g2', ascending=False)[:40].to_string())
|
||||
fp.write("\n")
|
||||
|
||||
Reference in New Issue
Block a user