Skip to content

Wrong number of individual sources? #10

@fsorrenti

Description

@fsorrenti

I was computing the number of individual sources but with a simple snippet I am able to find 1543 instead of the claimed 1550.

id_column = np.genfromtxt(
    "pantheon_shoes.dat", 
    usecols=(0,),  # Index of the ID column
    skip_header=1, 
    dtype=str  # Load as string
)


id_column = id_column.astype(str)


id_column = np.char.strip(id_column)  # Remove leading/trailing whitespace
id_column = np.char.lower(id_column)   # Convert to lowercase

unique_ids, counts = np.unique(id_column, return_counts=True)

num_unique_ids = len(unique_ids)

Could any give me feedback about it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions