Skip to content

Commit

Permalink
update the concept counts
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsage1 committed Mar 21, 2024
1 parent 8eb2ca5 commit 2cdf0ae
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions apps/openchallenges/edam-etl/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,21 @@ def print_info_statistics(df: pd.DataFrame) -> None:
if df is not None:
print(f"Number of Concepts Transformed: {len(df)}")
print(f"Column names: {df.columns.tolist()}")
print("Statistics:")
# Set the display options to show only 2 decimal places
pd.set_option("display.float_format", "{:.0f}".format)
print(df.describe())

# Count occurrences of specific concepts
concept_counts = df["preferred_label"].str.lower().value_counts()

# Print counts of specific concepts
print("\nConcept Counts:")
for concept in ["Data", "Operation", "Format"]:
concept_count = concept_counts.get(concept.lower(), 0)
print(f"{concept}: {concept_count}")

# Print counts of other concepts
other_count = sum(concept_counts) - sum(
concept_counts[["data", "operation", "format"]].fillna(0)
)
print(f"Other: {other_count}")
else:
print("No data available.")

Expand Down

0 comments on commit 2cdf0ae

Please sign in to comment.