Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[update][s] Fixing Dial code problem - refs #87. #89

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

gradedSystem
Copy link
Member

Changes made

  • Added function to handle the Dominican multiple Dial codes
  • Fixed dataset

Reference to the issue:

#87

cc @anuveyatsu

import pandas as pd

def format_dial_codes(dial):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gradedSystem what was the old script that handled this case correctly?

Copy link
Member Author

@gradedSystem gradedSystem Oct 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anuveyatsu I believe the old script scripts/statoids.py should be handling this case:

if ((len(row) > 1) and (row[1] == "DO")):
# TIL dominican republic has three dialing codes
# td.text_content() is '1-8091-8291-849'
# so split into list of 5 chars each and join with commas
row.append(','.join(map(''.join, zip(*[iter(td.text_content())]*5))))
continue

however it doesn't seem to work in this case

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gradedSystem ok so this is a unique case only for Dominican Republic. In this case I'm OK with the change you are proposing in this PR 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it is the only case

Copy link
Member

@anuveyatsu anuveyatsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@anuveyatsu anuveyatsu merged commit 92d82c2 into datasets:main Oct 9, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants