0

Dataframe to start with:

df = pd.DataFrame({

    # some ways to create random data
    'Team Name':np.random.choice( ['Team A','Team B','Team C','Team D','Team E','Team F'], 6,replace=False),
    'Product Owner City':np.random.choice( ['New York','Mumbai','Phoenix','Sunrise'], 6),
    'Scrum Master City':np.random.choice( ['New York','Mumbai','Phoenix','Sunrise'], 6),
    'Developers City':np.random.choice( ['New York','Mumbai','Phoenix','Sunrise'], 6)
    })

Is there a function, library to derive the Timezone in any particular way (open to suggestions). So that the output looks like below.

Team name   Product Owner City  Scrum Master City   Developers City
Team A          Timezone 1          Timezone 2          Timezone 3
Team B          Timezone 1          Timezone 1          Timezone 1

Final outcome I am driving towards is:

  1. If a team has Product Owner, Scrum Master and Developers in the same city = Team is colocated.
  2. Teams that have a partial overlap in timezones = Team is partially colocated.
  3. Teams that have no overlap in timezones = Team is not colocated.

For reference purpose I do have a list of distinct cities and the two digit country codes separately.

City Name City-Country Code
New York New York - US
Mumbai Mumbai - IN
Leo82
  • 3
  • 4
  • Consider that timezones change at the whim of local governments, sometimes with little notice. – Paul Dempsey Mar 17 '23 at 22:02
  • The timezone therefore also can also differ for the same city depending on your reference date (before or after the locality decides which time zone / savings time /date/time of change). There are a number of sources of data you can reference. The primary could be considered the one maintained by IANA: https://www.iana.org/time-zones – Paul Dempsey Mar 17 '23 at 22:12
  • If you have lat/lon coordinates for a given city, you can use [timezonefinder](https://github.com/jannikmi/timezonefinder) to get the time zone name. Here's an [example](https://github.com/FObersteiner/whenareyou/blob/master/whenareyou/whenareyou.py) how this can be done. Related: [Get Timezone from City in Python/Django](https://stackoverflow.com/q/16505501/10197418). – FObersteiner Mar 18 '23 at 12:49
  • City + Country is not enough information to disambiguate. Consider there are 9 cities in the United States named "Phoenix". – Matt Johnson-Pint Mar 19 '23 at 17:26

0 Answers0