b021eabdab
Refactored `script.py` by adding detailed docstrings and organizing functions. Created `.idea` configuration files and `gotodashboard.js` for `sisa_crawl` project. Added `readme.md` files with usage instructions and context for multiple scripts, and set up `package.json` for `sisa_crawl` dependencies.
25 lines
779 B
Python
25 lines
779 B
Python
import pandas as pd
|
|
|
|
# Constants
|
|
FILE_PATH = 'ps (30).xlsx'
|
|
SHEET_NAME = 'ps (30)'
|
|
COLUMN_NAME = 'Student-ID'
|
|
|
|
def find_duplicates(file_path, sheet_name, column_name):
|
|
df = pd.read_excel(file_path, sheet_name=sheet_name)
|
|
duplicate_ids = df[df.duplicated(subset=[column_name], keep=False)][column_name]
|
|
unique_duplicate_ids = duplicate_ids.drop_duplicates()
|
|
return unique_duplicate_ids
|
|
|
|
def main():
|
|
unique_duplicate_ids = find_duplicates(FILE_PATH, SHEET_NAME, COLUMN_NAME)
|
|
num_duplicates = len(unique_duplicate_ids)
|
|
|
|
if not unique_duplicate_ids.empty:
|
|
print(f"Duplicated {COLUMN_NAME} values (count: {num_duplicates}):")
|
|
print(unique_duplicate_ids)
|
|
else:
|
|
print("No duplicates found.")
|
|
|
|
if __name__ == "__main__":
|
|
main() |