data.py
def writing_csv_file (locations:list) :
    '''
    Writes given information in CSV file (film, year, location, latitude, longitude).
    '''
    start_idx = 10000 #there are a lot of data so I will go only with these films
    end_idx = 15000
    idx = 0
    with open('locations1.csv', 'w') as locations_file :
        locations_writer = csv.writer(locations_file, delimiter=',')
        for line in locations :
            idx += 1
            if start_idx < idx < end_idx :
                try :
                    location = geolocator.geocode(line[2])
                    if location :
                        locations_writer.writerow([line[0], line[1],\
                        location.latitude, location.longitude])
                except GeocoderUnavailable :
                    pass

    Writes given information in CSV file (film, year, location, latitude, longitude).
    
Writes given information in CSV file (film, year, location, latitude, longitude).
Writes given information in CSV file ( film year location latitude longitude ) .
def writing_csv_file (locations:list) :
    start_idx = 10000 
    end_idx = 15000
    idx = 0
    with open('locations1.csv', 'w') as locations_file :
        locations_writer = csv.writer(locations_file, delimiter=',')
        for line in locations :
            idx += 1
            if start_idx < idx < end_idx :
                try :
                    location = geolocator.geocode(line[2])
                    if location :
                        locations_writer.writerow([line[0], line[1],\
                        location.latitude, location.longitude])
                except GeocoderUnavailable :
                    pass
def writing_csv_file ( locations : list ) : start_idx = 10000 end_idx = 15000 idx = 0 with open ( 'locations1.csv' , 'w' ) as locations_file : locations_writer = csv . writer ( locations_file , delimiter = ',' ) for line in locations : idx += 1 if start_idx < idx < end_idx : try : location = geolocator . geocode ( line [ 2 ] ) if location : locations_writer . writerow ( [ line [ 0 ] , line [ 1 ] , location . latitude , location . longitude ] ) except GeocoderUnavailable : pass
Writes given information in CSV file (film, year, location, latitude, longitude).
Writes given information in CSV file ( film year location latitude longitude ) .
'''
    Writes given information in CSV file (film, year, location, latitude, longitude).
    ''' #there are a lot of data so I will go only with these films
locations
list