ium_434760/stats.py

19 lines
580 B
Python
Raw Normal View History

2021-04-11 23:06:50 +02:00
stats = []
with open("data.csv", "r") as f:
lines_count = len(f.readlines())
stats.append(f"data.csv - {lines_count} lines\n")
with open("dev.csv", "r") as f:
lines_count = len(f.readlines())
stats.append(f"dev.csv - {lines_count} lines\n")
with open("test.csv", "r") as f:
lines_count = len(f.readlines())
stats.append(f"test.csv - {lines_count} lines\n")
with open("train.csv", "r") as f:
lines_count = len(f.readlines())
stats.append(f"train.csv - {lines_count} lines\n")
with open("stat.txt", "w+") as f:
f.writelines(stats)