ium_434760/stats.py
2021-04-11 23:11:21 +02:00

19 lines
580 B
Python

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)