Skip to content

Instantly share code, notes, and snippets.

@leonardo-iheme
leonardo-iheme / kmeans.py
Created July 25, 2019 11:18
kmeans snippete
# set number of clusters
kclusters = 5
#Drop categorical variables
clustering = coffee_shops_population.drop(['Neighborhood', 'District', 'Latitude', 'Longitude'], 1)
# Normalizing over the standard deviation
from sklearn.preprocessing import StandardScaler
X = clustering.values[:,1:]
X = np.nan_to_num(X)
@leonardo-iheme
leonardo-iheme / df_population_demographics.csv
Last active July 25, 2019 10:51
population demographics
Population & Demographics Data Geographical Data Location Data
The list of neighborhoods in each district Coordinates The list of coffee shops
The population of each neighborhood Neighborhood boundaries
The average price of residential rent at each neighborhood
@leonardo-iheme
leonardo-iheme / neighborhoods.csv
Last active July 25, 2019 09:16
df_neighborhoods_postcodes
Idx Post_codes Neighborhood
0 34022 ABBASAĞA MAH., CIHANNUMA MAH., SİNANPAŞA MAH.
1 34330 KONAKLAR MAH., LEVENT MAH.
2 34335 AKAT MAH.
3 34337 ETİLER MAH.
4 34340 KÜLTÜR MAH., LEVAZIM MAH., NİSBETİYE MAH., ULU...
def get_syllables(word):
syllables = []
"""
Aşağıdaki satır gelen kelimenin ünlü harfler 1, ünsüzler 0 olacak
şekilde desenini çıkarır.
Örneğin: arabacı -> 1010101, türkiye -> 010010
"""