Skip to content

Commit

Permalink
feat: add count lines script
Browse files Browse the repository at this point in the history
  • Loading branch information
guissalustiano committed Apr 28, 2023
1 parent 5a12ca8 commit d1f4ac8
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from glob import glob
import pandas as pd
from loguru import logger

csv_filepaths = glob('../input/**/*.csv', recursive=True)

count = 0
for filepath in csv_filepaths:
logger.info(f"reading {filepath}")
df = pd.read_csv(filepath, encoding="utf-8", index_col=0)
size = len(df.index)
logger.debug(f"{filepath} has {size}")
count += size

logger.info(f"Total: {count}")

0 comments on commit d1f4ac8

Please sign in to comment.