Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- def zeros_count(list):
- zeros = 0
- for l in list:
- if float(l) == 0:
- zeros += 1
- print(zeros)
- return zeros
- def main():
- inp, out = sys.argv[1], sys.argv[2]
- with open(inp, "r") as input:
- with open(out, "w") as output:
- i = 0
- for line in input:
- if i == 0:
- i += 1
- continue
- z = line.split()
- sen, date, *hist = z
- if zeros_count(hist) / len(hist) < 0.3:
- output.write(line)
- output.close()
- input.close()
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement