<jupyter_start><jupyter_text>Selecting subway stations by geographical coordinatesIt turns out that all but four of the largest 100 tech companies are located within a small slice of Manhattan, New York. The code below defines that region, which we will then use to filter for subway stations where we anticipate people will be more receptive to a women-in-tech conference. [Click here for the link to the article.](https://www.builtinnyc.com/2016/12/13/big-tech-companies-nyc-locations)<jupyter_code>#coordinates for tech companies centered around World Trade Center (smaller circle)
point1 = (40.708984, -74.0111239) #SW Corner
point2 = (40.712274, -74.007657)  #SE Corner
point3 = (40.714746, -74.009200)  #NE Corner
point4 = (40.714830, -74.016226) #NW corner
#coordinates that include almost all large tech companies(larger circle)
point5 = (40.762261, -73.966260) #NE corner
point6 = (40.701598, -74.012487) #SE corner
point7 = (40.767958, -73.995653) #W corner
def coords_max_min(points):
   '''
   Accepts a list of coordinate pairs, [(latitude, longitude)].
   Returns a tuple with the maximum and minimum longitude and lattitudes
   (max_lat, min_lat, max_longs, min_longs)
   '''

   lats, longs = [], []

   for point in points:
       lats.append(point[0])
       longs.append(point[1])

   return (max(lats), min(lats), max(longs), min(longs))
shorter_points = [point1, point2, point3, point4]
longer_points = [point5, point6, point7]

station_entrances = pd.read_csv('http://web.mta.info/developers/data/nyct/subway/StationEntrances.csv')
station_entrances.head()<jupyter_output><empty_output><jupyter_text>Getting the short-list of companies located within the higher concentration nucleus in lower-west ManhattanHere we use the `coords_max_min` function to get the maximum and minimum latitutude and longitude points for filtering stations.<jupyter_code>lat_max, lat_min, long_max, long_min = coords_max_min(shorter_points) 
#Filters out stations outside of max & min lat/long coordinates 
short_list = station_entrances[(station_entrances['Station_Latitude'] > lat_min) & (station_entrances['Station_Latitude'] < lat_max)\
            & (station_entrances['Station_Longitude'] > long_min) & (station_entrances['Station_Longitude'] < long_max)]
short_list.describe()
set(short_list['Station_Name']) #Unique stations within the concentration of tech firms around World Trade Center<jupyter_output><empty_output><jupyter_text>Getting a broader swath of ManhattanThe coordinates used in this list select for a map of Manhattan.<jupyter_code>lat_max, lat_min, long_max, long_min = coords_max_min(longer_points)
#Filters out all stations outside of Silicon Alley
longer_list = station_entrances[(station_entrances['Station_Latitude'] > lat_min) & (station_entrances['Station_Latitude'] < lat_max)\
            & (station_entrances['Station_Longitude'] > long_min) & (station_entrances['Station_Longitude'] < long_max)]
longer_list
set(longer_list['Station_Name']) #Unique stations within entire span of Silicon Alley
longer_list['Station_Name'].nunique()
longer_list.groupby(['Station_Name']).size() #Size possibly worth considering for best stations to send street team
longer_list.loc[longer_list['Station_Name'] == 'Grand Central-42nd St'] #Checking if large # of rows means duplicate stations
longer_list.groupby(['Division','Line','Station_Name']).size() #Looking for duplicate stations within larger python Set of stations 
longer_list.groupby(['Station_Name', 'Line', 'Division']).size() #Checking for duplicate stations
short_list.groupby(['East_West_Street', 'North_South_Street', 'Station_Name']).size()
longer_list.to_pickle('longer_list.pkl')
del longer_list<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10560344827586207, 'fraction_numerical': 0.03825431034482758, 'mean_word_length': 6.251953125, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '581290', 'license': 'MIT', 'n_tokens_mistral': 1248, 'n_tokens_neox': 1152, 'n_words': 331, 'path': 'project_1/Coordinates Project 1.ipynb', 'repo_name': 'skylerl2/skylerl2.github.io', 'size': '3712'}