Skip to content

Commit

Permalink
Add type counts
Browse files Browse the repository at this point in the history
  • Loading branch information
palewire committed Nov 13, 2023
1 parent 0bc5a2e commit 7afe9e9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
11 changes: 11 additions & 0 deletions data/clean/type_counts.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
type,n
calendar,1
chart,1
datalens,20
dataset,2716
file,185
filter,25
href,154
map,353
story,3
visualization,4
7 changes: 7 additions & 0 deletions src/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ def transform(verbose: bool) -> None:
subset=["id"], keep="first"
)

# Type counts
if verbose:
print("Type counts")
type_counts = latest_df.groupby("type").size()
type_counts.name = "n"
type_counts.to_csv(utils.DATA_DIR / "clean" / "type_counts.csv", header=True)

# Write it out as csv
out_path = utils.DATA_DIR / "clean" / "latest.csv"
if verbose:
Expand Down

0 comments on commit 7afe9e9

Please sign in to comment.