'Count rows with column value greater than - Big csv python
I have a very large csv of around 35 million lines.
I have a simple python that counts me the total lines :
file_name = 'extract.csv'
start = time.time()
with open(file_name) as f:
line_count = sum(1 for line in f)
print(line_count)
The executable is very fast, and works well without memory blocks.
Now I need to count the rows which contain greater or less value than X in column Y.
How can I solve without crashes and without slowing down the execution too much?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
