-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new script to capture number of symbols typically
- Loading branch information
Showing
3 changed files
with
647 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#! /usr/bin/env python3 | ||
|
||
import json | ||
import os | ||
|
||
import pandas as pd | ||
from plotnine import ( | ||
aes, | ||
after_stat, | ||
geom_histogram, | ||
ggplot, | ||
labs, | ||
save_as_pdf_pages, | ||
theme_minimal, | ||
) | ||
|
||
SCRIPT_DIR = os.path.dirname(__file__) | ||
JSON_FILE = open(os.path.join(SCRIPT_DIR, "symbols-ubuntu.json"), "r") | ||
|
||
# Load JSON data into a Python dictionary | ||
data_dict = json.load(JSON_FILE) | ||
|
||
# Convert to DataFrame | ||
df = pd.DataFrame(list(data_dict.items()), columns=["File", "Symbols"]) | ||
|
||
# Create plot | ||
plot = ( | ||
ggplot(df, aes(x="Symbols", y=after_stat("ncount"))) | ||
+ geom_histogram(bins=100, fill="skyblue", color="black", alpha=0.7) | ||
+ labs(title="", x="Number of Symbols", y="Normalized Count") | ||
+ theme_minimal() | ||
) | ||
|
||
save_as_pdf_pages([plot]) |
Oops, something went wrong.