Dataset Viewer
Auto-converted to Parquet Duplicate
geonameid
int64
1.11M
13.7M
name
large_stringlengths
3
57
ascii_name
large_stringlengths
3
57
latitude
float64
24.1
36.5
longitude
float64
61.6
76.2
feature_code
large_stringclasses
12 values
province
large_stringclasses
7 values
population
int64
4
13M
log_population
float64
0.6
7.11
elevation_m
int64
3
2.76k
elevation_source
large_stringclasses
2 values
timezone
large_stringclasses
1 value
modification_date
timestamp[us]date
2011-02-08 00:00:00
2026-11-27 00:00:00
pop_shared_with_namesake
bool
2 classes
1,106,880
Sharifabad
Sharifabad
33.4341
73.36276
PPL
Punjab
55,027
4.740576
578
dem
Asia/Karachi
2025-12-16T00:00:00
false
1,107,099
Inzari
Inzari
34.66879
71.3888
PPL
Khyber Pakhtunkhwa
10,000
4
988
dem
Asia/Karachi
2025-12-16T00:00:00
false
1,108,161
Chuhar Jamali
Chuhar Jamali
24.3944
67.99298
PPL
Sindh
18,721
4.272329
9
dem
Asia/Karachi
2026-01-09T00:00:00
false
1,109,262
Datta Khel
Datta Khel
32.90849
69.74477
PPL
Khyber Pakhtunkhwa
1,037
3.015779
1,320
dem
Asia/Karachi
2025-12-16T00:00:00
false
1,111,532
Maimola
Maimola
34.63507
71.61144
PPL
Khyber Pakhtunkhwa
530
2.724276
880
dem
Asia/Karachi
2025-12-16T00:00:00
false
1,111,737
Batwar Salarzai
Batwar Salarzai
34.92564
71.51414
PPL
Khyber Pakhtunkhwa
5,267
3.721563
1,462
dem
Asia/Karachi
2025-12-16T00:00:00
false
1,161,983
Rawalakot
Rawalakot
33.85782
73.76043
PPLA2
Azad Kashmir
50,000
4.69897
1,640
dem
Asia/Karachi
2025-05-04T00:00:00
false
1,161,991
Pir Jo Goth
Pir Jo Goth
27.59178
68.61848
PPL
Sindh
54,266
4.734528
63
dem
Asia/Karachi
2026-06-19T00:00:00
false
1,162,004
Khairpur Mir’s
Khairpur Mir's
27.52948
68.75915
PPLA2
Sindh
191,044
5.281133
60
dem
Asia/Karachi
2025-02-04T00:00:00
false
1,162,035
Adilpur
Adilpur
27.93677
69.31941
PPL
Sindh
8,247
3.916296
73
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,162,094
Ziarat
Ziarat
30.38244
67.72562
PPLA2
Balochistan
733
2.865104
2,433
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,162,105
Zhob
Zhob
31.34082
69.4493
PPLA2
Balochistan
50,537
4.703609
1,409
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,162,261
Zaida
Zaida
34.0595
72.4669
PPL
Khyber Pakhtunkhwa
34,200
4.534026
320
dem
Asia/Karachi
2026-06-21T00:00:00
false
1,162,275
Zahir Pir
Zahir Pir
28.81284
70.52341
PPL
Punjab
76,979
4.886372
93
dem
Asia/Karachi
2026-06-19T00:00:00
false
1,162,285
Zafarwal
Zafarwal
32.34464
74.8999
PPL
Punjab
23,078
4.363198
273
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,162,311
Yougu
Yougu
35.18434
76.15882
PPL
Gilgit-Baltistan
6,000
3.778151
2,464
dem
Asia/Karachi
2026-01-08T00:00:00
false
1,162,316
Yazman
Yazman
29.12122
71.74459
PPL
Punjab
60,738
4.78346
120
dem
Asia/Karachi
2026-06-19T00:00:00
false
1,162,456
Wazirabad
Wazirabad
32.44324
74.12
PPL
Punjab
152,624
5.183623
231
dem
Asia/Karachi
2026-06-17T00:00:00
false
1,162,500
Washuk
Washuk
27.72728
64.80972
PPL
Balochistan
41,107
4.613916
704
dem
Asia/Karachi
2026-06-19T00:00:00
false
1,162,572
Chak Five Hundred Seventy-five
Chak Five Hundred Seventy-five
31.54514
73.82891
PPL
Punjab
30,738
4.487676
202
dem
Asia/Karachi
2026-06-21T00:00:00
false
1,162,589
Warah
Warah
27.44805
67.79654
PPL
Sindh
18,724
4.272399
51
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,162,634
Wana
Wana
32.29889
69.5725
PPL
Khyber Pakhtunkhwa
2,223
3.346939
1,390
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,162,813
Vihari
Vihari
30.0445
72.3556
PPLA2
Punjab
112,840
5.052463
140
dem
Asia/Karachi
2026-09-14T00:00:00
false
1,162,846
Uzhnu
Uzhnu
36.54541
72.46876
PPL
Khyber Pakhtunkhwa
5
0.69897
2,617
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,162,855
Utmanzai
Utmanzai
34.18775
71.76274
PPL
Khyber Pakhtunkhwa
34,257
4.534749
304
dem
Asia/Karachi
2025-12-16T00:00:00
false
1,162,862
Uthal
Uthal
25.80722
66.62194
PPLA2
Balochistan
16,483
4.217036
43
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,162,868
Usta Muhammad
Usta Muhammad
28.17723
68.04367
PPL
Balochistan
64,632
4.810448
57
dem
Asia/Karachi
2026-06-19T00:00:00
false
1,162,959
Umarkot
Umarkot
25.36329
69.74184
PPLA2
Sindh
144,558
5.160042
20
dem
Asia/Karachi
2026-09-14T00:00:00
false
1,163,021
Ubauro
Ubauro
28.16429
69.73114
PPL
Sindh
50,981
4.707408
74
dem
Asia/Karachi
2026-06-19T00:00:00
false
1,163,054
Turbat
Turbat
26.00122
63.04849
PPLA2
Balochistan
75,694
4.879061
129
elevation
Asia/Karachi
2019-12-06T00:00:00
false
1,163,198
Tordher
Tordher
33.99047
72.2863
PPL
Khyber Pakhtunkhwa
150,000
5.176091
298
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,163,224
Topi
Topi
34.07034
72.62147
PPL
Khyber Pakhtunkhwa
74,867
4.87429
348
dem
Asia/Karachi
2025-11-17T00:00:00
false
1,163,272
Toba Tek Singh
Toba Tek Singh
30.97127
72.48275
PPLA2
Punjab
123,102
5.090265
161
dem
Asia/Karachi
2026-09-14T00:00:00
false
1,163,414
Thul
Thul
28.2403
68.7755
PPL
Sindh
88,554
4.947208
64
dem
Asia/Karachi
2026-06-19T00:00:00
false
1,163,582
Thatta
Thatta
24.74745
67.92353
PPLA2
Sindh
44,302
4.646423
17
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,163,595
Tharu Shah
Tharu Shah
26.9423
68.11759
PPL
Sindh
17,698
4.247924
49
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,163,634
Thamewali
Thamewali
32.78357
71.7808
PPL
Punjab
7,300
3.863323
468
dem
Asia/Karachi
2023-05-20T00:00:00
false
1,163,724
Taunsa
Taunsa
30.70358
70.65054
PPL
Punjab
115,704
5.063348
175
dem
Asia/Karachi
2026-09-14T00:00:00
false
1,163,905
Tank
Tank
32.21707
70.38315
PPLA2
Khyber Pakhtunkhwa
38,488
4.585325
259
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,163,912
Tangwani
Tangwani
28.27886
68.9976
PPL
Sindh
9,255
3.966376
68
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,163,927
Tangi
Tangi
34.3009
71.65238
PPL
Khyber Pakhtunkhwa
35,659
4.552169
358
dem
Asia/Karachi
2026-06-20T00:00:00
false
1,163,952
Tando Muhammad Khan
Tando Muhammad Khan
25.12384
68.53677
PPLA2
Sindh
114,406
5.058449
24
dem
Asia/Karachi
2026-09-14T00:00:00
false
1,163,953
Tando Mitha Khan
Tando Mitha Khan
25.99625
69.20251
PPL
Sindh
2,723
3.435048
21
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,163,958
Tando Jam
Tando Jam
25.42813
68.52923
PPL
Sindh
71,760
4.855882
24
dem
Asia/Karachi
2026-06-19T00:00:00
false
1,163,964
Tando Bago
Tando Bago
24.78914
68.96535
PPL
Sindh
426,535
5.629955
18
dem
Asia/Karachi
2026-09-14T00:00:00
false
1,163,965
Tando Allahyar
Tando Allahyar
25.4605
68.71745
PPLA2
Sindh
421,923
5.625233
23
dem
Asia/Karachi
2026-09-14T00:00:00
false
1,163,967
Tando Adam
Tando Adam
25.76818
68.66196
PPL
Sindh
174,291
5.241275
29
dem
Asia/Karachi
2026-09-14T00:00:00
false
1,163,968
Tandlianwala
Tandlianwala
31.03359
73.13268
PPL
Punjab
38,285
4.583029
184
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,164,045
Talhar
Talhar
24.88454
68.81437
PPL
Sindh
200,014
5.30106
15
dem
Asia/Karachi
2026-09-14T00:00:00
false
1,164,064
Talamba
Talamba
30.52693
72.24079
PPL
Punjab
28,151
4.449494
149
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,164,069
Talagang
Talagang
32.92766
72.41594
PPL
Punjab
79,431
4.89999
463
dem
Asia/Karachi
2026-06-19T00:00:00
true
1,164,076
Thal
Thal
35.47836
72.24383
PPL
Khyber Pakhtunkhwa
29,331
4.467327
2,056
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,164,216
Swabi
Swabi
34.12018
72.46982
PPLA2
Khyber Pakhtunkhwa
97,363
4.988394
341
dem
Asia/Karachi
2019-12-20T00:00:00
false
1,164,245
Surkhpur
Surkhpur
32.71816
74.44773
PPL
Punjab
20,000
4.30103
255
dem
Asia/Karachi
2018-09-04T00:00:00
false
1,164,306
Surab
Surab
28.49276
66.25999
PPL
Balochistan
13,104
4.117404
1,762
dem
Asia/Karachi
2026-06-20T00:00:00
false
1,164,408
Sukkur
Sukkur
27.70323
68.85889
PPLA2
Sindh
563,851
5.751164
72
dem
Asia/Karachi
2025-02-04T00:00:00
false
1,164,419
Sukheke Mandi
Sukheke Mandi
31.86541
73.50875
PPL
Punjab
42,626
4.629675
205
dem
Asia/Karachi
2026-06-19T00:00:00
false
1,164,660
Sohbatpur
Sohbatpur
28.52038
68.54298
PPL
Balochistan
8,940
3.951338
59
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,164,679
Sodhri
Sodhri
32.46211
74.18207
PPL
Punjab
15,977
4.203495
238
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,164,698
Sobhodero
Sobhodero
27.30475
68.39715
PPL
Sindh
14,623
4.165036
55
dem
Asia/Karachi
2019-12-24T00:00:00
false
1,164,709
Skardu
Skardu
35.29787
75.63372
PPLA2
Gilgit-Baltistan
260,000
5.414973
2,241
dem
Asia/Karachi
2025-05-04T00:00:00
false
1,164,716
Sita Road
Sita Road
27.03333
67.85
PPL
Sindh
27,587
4.440704
44
dem
Asia/Karachi
2022-04-16T00:00:00
false
1,164,776
Sinjhoro
Sinjhoro
26.03008
68.80867
PPL
Sindh
354,709
5.549872
25
dem
Asia/Karachi
2026-09-14T00:00:00
false
1,164,825
Sillanwali
Sillanwali
31.82539
72.54064
PPL
Punjab
49,311
4.692944
182
dem
Asia/Karachi
2026-06-19T00:00:00
false
1,164,896
Sibi
Sibi
29.54299
67.87726
PPLA2
Balochistan
64,069
4.806648
136
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,164,909
Sialkot
Sialkot
32.49268
74.53134
PPLA2
Punjab
911,817
5.959908
250
dem
Asia/Karachi
2025-05-08T00:00:00
false
1,164,970
Shujaabad
Shujaabad
29.88092
71.29344
PPL
Punjab
151,115
5.179308
123
dem
Asia/Karachi
2026-09-14T00:00:00
false
1,164,987
Shorkot
Shorkot
31.91023
70.87757
PPL
Khyber Pakhtunkhwa
67,439
4.828911
182
dem
Asia/Karachi
2019-12-16T00:00:00
false
1,165,057
Shinpokh
Shinpokh
34.32959
71.17852
PPL
Khyber Pakhtunkhwa
1,111
3.045714
402
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,165,108
Shikarpur
Shikarpur
27.95558
68.63823
PPLA2
Sindh
204,938
5.311622
71
dem
Asia/Karachi
2026-09-14T00:00:00
false
1,165,221
Shekhupura
Shekhupura
31.71287
73.98556
PPLA2
Punjab
591,424
5.771899
210
dem
Asia/Karachi
2025-02-05T00:00:00
false
1,165,260
Sharqpur Sharif
Sharqpur Sharif
31.46116
74.10091
PPL
Punjab
31,855
4.503178
211
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,165,322
Goth Shams Pir
Goth Shams Pir
24.84414
66.92181
PPL
Sindh
5,001
3.699057
9
dem
Asia/Karachi
2025-09-18T00:00:00
false
1,165,388
Shakargarh
Shakargarh
32.26361
75.16008
PPL
Punjab
126,742
5.102921
266
dem
Asia/Karachi
2026-09-14T00:00:00
false
1,165,486
Shahr Sultan
Shahr Sultan
29.57517
71.02209
PPL
Punjab
16,166
4.208603
111
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,165,507
Shahpur Chakar
Shahpur Chakar
26.15411
68.65013
PPL
Sindh
21,446
4.331346
29
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,165,518
Shahpur
Shahpur
32.2682
72.46884
PPL
Punjab
14,153
4.150849
184
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,165,569
Shahkot
Shahkot
31.5709
73.48531
PPL
Punjab
244,868
5.388932
190
elevation
Asia/Karachi
2026-09-14T00:00:00
false
1,165,635
Shahdadpur
Shahdadpur
25.92539
68.6228
PPL
Sindh
113,342
5.054391
30
dem
Asia/Karachi
2026-09-14T00:00:00
false
1,165,638
Shahdad Kot
Shahdad Kot
27.84726
67.90679
PPLA2
Sindh
120,687
5.08166
52
dem
Asia/Karachi
2026-09-14T00:00:00
false
1,165,744
Shabqadar
Shabqadar
34.21599
71.5548
PPL
Khyber Pakhtunkhwa
102,340
5.010045
335
dem
Asia/Karachi
2026-09-14T00:00:00
false
1,165,778
Sehnsa
Sehnsa
33.51366
73.75479
PPL
Azad Kashmir
10,568
4.023993
674
dem
Asia/Karachi
2026-06-20T00:00:00
false
1,165,789
Sehwan
Sehwan
26.42495
67.86126
PPL
Sindh
41,150
4.61437
40
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,166,000
Sargodha
Sargodha
32.08586
72.67418
PPLA2
Punjab
975,886
5.989399
187
dem
Asia/Karachi
2025-02-04T00:00:00
false
1,166,062
Sarai Sidhu
Sarai Sidhu
30.59476
71.9699
PPL
Punjab
15,632
4.194015
143
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,166,066
Sarai Naurang
Sarai Naurang
32.82581
70.78107
PPL
Khyber Pakhtunkhwa
19,694
4.294334
305
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,166,073
Sarai Alamgir
Sarai Alamgir
32.90495
73.75518
PPL
Punjab
73,967
4.869038
232
dem
Asia/Karachi
2026-06-19T00:00:00
false
1,166,115
Sann
Sann
26.0403
68.13763
PPL
Sindh
8,834
3.946157
35
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,166,118
Sanjwal
Sanjwal
33.76105
72.43315
PPL
Punjab
10,657
4.027635
357
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,166,146
Sangla Hill
Sangla Hill
31.71667
73.38333
PPL
Punjab
103,709
5.015816
194
dem
Asia/Karachi
2026-09-14T00:00:00
false
1,166,164
Sanghar
Sanghar
26.04694
68.94917
PPLA2
Sindh
62,033
4.792623
26
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,166,265
Sambrial
Sambrial
32.47835
74.35338
PPL
Punjab
119,571
5.077626
239
dem
Asia/Karachi
2026-09-14T00:00:00
false
1,166,275
Samaro
Samaro
25.28143
69.39623
PPL
Sindh
8,784
3.943692
18
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,166,381
Sakrand
Sakrand
26.13845
68.27444
PPL
Sindh
72,040
4.857574
36
dem
Asia/Karachi
2026-06-18T00:00:00
false
1,166,480
Saidpur
Saidpur
33.74188
73.07046
PPL
Islamabad Capital Territory
15,000
4.176091
618
dem
Asia/Karachi
2026-06-20T00:00:00
false
1,166,547
Sahiwal
Sahiwal
31.97386
72.33109
PPL
Punjab
538,344
5.73106
171
dem
Asia/Karachi
2026-06-19T00:00:00
true
1,166,548
Sahiwal
Sahiwal
30.66595
73.10186
PPLA2
Punjab
538,344
5.73106
174
dem
Asia/Karachi
2025-02-05T00:00:00
true
1,166,652
Saddiqabad
Saddiqabad
28.3091
70.12652
PPL
Punjab
274,210
5.438083
78
dem
Asia/Karachi
2026-09-14T00:00:00
false
1,166,720
Rustam
Rustam
27.96705
68.80386
PPL
Sindh
9,048
3.956553
70
dem
Asia/Karachi
2019-12-06T00:00:00
false
1,166,735
Chak One Hundred Forty-one Nine Left
Chak One Hundred Forty-one Nine Left
30.51562
72.96403
PPL
Punjab
5,087
3.706462
166
dem
Asia/Karachi
2024-03-09T00:00:00
false
End of preview. Expand in Data Studio

Pakistan populated places (GeoNames): location, province, elevation, population

Part of pakdata, a collection of real, openly licensed Pakistan-specific datasets for machine learning. Every value comes from the named public source below; nothing is synthetic or AI-generated.

Rows 575
Default target log_population (regression)
Source GeoNames (geonames.org daily export PK.zip + admin1CodesASCII.txt)
License CC BY 4.0
Snapshot 2026.11

Load it

# pakdata (scikit-learn style, works offline)   pip install pakdata
from pakdata import load_pak_cities
X, y = load_pak_cities(return_X_y=True)

# Hugging Face datasets (also gives PyTorch / TensorFlow / JAX formats)
from datasets import load_dataset
ds = load_dataset("junaid008/pak_cities", split="train")
torch_ds = ds.with_format("torch")

# pandas / Polars / DuckDB, straight from the Hub
import pandas as pd;  df = pd.read_parquet("hf://datasets/junaid008/pak_cities/data/train.parquet")
import polars as pl;  df = pl.read_parquet("hf://datasets/junaid008/pak_cities/data/train.parquet")
import duckdb;        duckdb.sql("SELECT * FROM 'hf://datasets/junaid008/pak_cities/data/train.parquet'")

Plain CSV (Excel, R, Julia, MATLAB, SPSS, anything): https://huggingface.co/datasets/junaid008/pak_cities/resolve/main/csv/pak_cities.csv

df <- read.csv("https://huggingface.co/datasets/junaid008/pak_cities/resolve/main/csv/pak_cities.csv")

JSON API (JavaScript, mobile apps, any language): https://datasets-server.huggingface.co/rows?dataset=junaid008/pak_cities&config=default&split=train&offset=0&length=100

Features used by pakdata: latitude, longitude, feature_code, province, elevation_m, elevation_source

Kept in the table but not used as features (ids, raw dates, or columns that would leak the target): geonameid, name, ascii_name, population, timezone, modification_date, pop_shared_with_namesake

Data card

The full data card (column meanings and units, how it was built, caveats, suggested tasks):

.. _pak_cities_dataset:

Pakistan populated places (GeoNames)
------------------------------------

**Data Set Characteristics:**

:Number of Instances: 575 populated places (one row per GeoNames feature)
:Number of Attributes: 6 features (``latitude``, ``longitude``, ``feature_code``, ``province``, ``elevation_m``, ``elevation_source``) + target; 14 columns in ``frame``
:Default target: ``log_population`` (log10 of persons)
:Time coverage: static gazetteer snapshot; records last modified between 2011-02-08 and 2026-11-27; population figures are of mixed, mostly undated vintage
:Geographic coverage: Pakistan (all 4 provinces, Islamabad Capital Territory, Gilgit-Baltistan, Azad Kashmir); latitude 24.1-36.5 N, longitude 61.6-76.2 E
:Source: GeoNames geographical database, daily export https://download.geonames.org/export/dump/PK.zip and https://download.geonames.org/export/dump/admin1CodesASCII.txt (https://www.geonames.org)
:License: Creative Commons Attribution 4.0 (CC BY 4.0), https://creativecommons.org/licenses/by/4.0/ , as stated in https://download.geonames.org/export/dump/readme.txt and https://www.geonames.org/about.html
:Snapshot: 2026.11 (retrieved 2026-11-29)

**Columns:**

- ``geonameid`` (int): GeoNames feature id (identifier; excluded from features)
- ``name`` (str): place name as in GeoNames, UTF-8 (excluded from features)
- ``ascii_name`` (str): plain-ASCII name (excluded from features)
- ``latitude`` (degrees, WGS84): latitude of the place point
- ``longitude`` (degrees, WGS84): longitude of the place point
- ``feature_code`` (category): GeoNames populated-place code. Counts in this file:
  PPL populated place 456, PPLA2 seat of 2nd-order admin division (district) 91,
  PPLA seat of 1st-order division (provincial capital) 6, PPLX section of populated place 6,
  PPLL locality 4, PPLF farm village 3, PPLA3 2, PPLW destroyed place 2,
  PPLQ abandoned place 2, PPLC capital (Islamabad) 1, PPLA4 1, PPLS populated places 1
- ``province`` (category): province / territory mapped from the GeoNames admin1 code
  (PK.02 Balochistan, PK.03 Khyber Pakhtunkhwa, PK.04 Punjab, PK.05 Sindh,
  PK.06 Azad Kashmir, PK.07 Gilgit-Baltistan, PK.08 Islamabad, renamed here to
  "Islamabad Capital Territory"). Counts: Punjab 285, Sindh 134, Khyber Pakhtunkhwa 77,
  Balochistan 49, Azad Kashmir 20, Gilgit-Baltistan 7, Islamabad Capital Territory 3
- ``population`` (persons): population as recorded in GeoNames (raw; excluded from
  features because it determines the target)
- ``log_population`` (log10 persons): ``log10(population)``, the default target (also
  listed in ``exclude_from_features``, so it is never a feature when another
  population column is chosen as target)
- ``elevation_m`` (m): GeoNames ``elevation`` field when filled (32 rows), otherwise the
  GeoNames ``dem`` field (543 rows; SRTM3 ~90 m or GTOPO30 ~900 m average terrain height
  around the point)
- ``elevation_source`` (category): ``elevation`` or ``dem``, which GeoNames field ``elevation_m`` came from
- ``timezone`` (str): IANA timezone; ``Asia/Karachi`` for every row (excluded from features as constant)
- ``modification_date`` (date): date the GeoNames record was last modified (excluded from features)
- ``pop_shared_with_namesake`` (bool): True when another row with the same ``ascii_name``
  has exactly the same ``population`` (8 rows, 4 pairs; see caveats). Computed by pakdata
  from the source values; it is derived from ``population`` and is excluded from features

**How it was built:** ``scripts/build_pak_cities.py`` downloads PK.zip (all ~230,000
GeoNames features for Pakistan) and admin1CodesASCII.txt, keeps rows with feature class
``P`` (populated places) and population > 0, maps the admin1 code to the province name,
computes ``log_population = log10(population)``, builds ``elevation_m`` from ``elevation``
falling back to ``dem`` (DEM value -9999 would be treated as missing; none occurred),
flags ``pop_shared_with_namesake``, rounds coordinates to 5 decimals and sorts rows by
``geonameid``. No values were imputed;
in this snapshot no column has missing values.

**Caveats and known biases:**

- GeoNames populations are NOT the 2023 Pakistan census (nor any single census). They come
  from many contributors and sources of uneven vintage and accuracy; some are city-proper,
  some metropolitan, some rounded estimates (e.g. Malir Cantonment 300000), and a few very
  small values (4-14 persons) are user-added entries such as havelis or farmsteads.
  Use them for ML practice, not for demographic statements.
- Strong selection bias: only 575 of about 150,000 populated places (feature class P;
  150,406 of the 229,987 features in this PK.txt snapshot) have a population filled in. Larger towns and district seats
  are heavily over-represented, so the data is not a random sample of settlements.
- Some population figures appear to be copied between different, same-named places in
  GeoNames, so a few rows are wrong at the source (pakdata keeps the source values
  unchanged). Pairs in this snapshot: Sahiwal 1166548 (PPLA2, district city, 30.67 N)
  and Sahiwal 1166547 (small town in Sargodha district, 31.97 N) both carry 538344;
  Bahawalnagar 1183883 (PPLA2) and 1332083 (PPL, 30.55 N) both carry 241873;
  Talagang 1164069 and 1335232 (33.07 N 71.93 E) both carry 79431; Noorabad 1453226
  (Khyber Pakhtunkhwa) and 11027195 (Sindh) both carry 1100. These rows are marked by
  ``pop_shared_with_namesake``; consider dropping them, or at least the smaller
  non-seat member of each pair, e.g.
  ``df = df[~df.pop_shared_with_namesake]``. Some other figures describe a tehsil or
  metropolitan area rather than the town itself (e.g. Chunian 634236).
- Coverage is very uneven by region (Punjab 285 rows vs Gilgit-Baltistan 7, ICT 3).
- ``elevation_source == "elevation"`` rows are mostly recently hand-added small places, so
  that column partly encodes "who entered the record" rather than geography.
- Includes a few sections of cities (PPLX, e.g. Wah Cantt, Malir Cantonment) and destroyed
  or abandoned places (PPLW, PPLQ) whose population figures may be historical. Places can
  overlap (a PPLX section inside a city is counted separately from that city).
- Coordinates are single points (often the town centre); DEM elevation is an area average.
- GeoNames is a crowd-edited wiki; rerunning the build script later may give different rows.

**Suggested tasks:**

1. Regression: predict ``log_population`` from location, elevation, province and
   ``feature_code``; compare LinearRegression with a RandomForest (5-fold CV R^2 is about
   0.26 and 0.31 respectively in this snapshot, so the task is hard and not leaked).
2. Classification: ``load_pak_cities(target="province")`` and predict the province from
   coordinates (plus elevation); a RandomForest reaches roughly 0.94 accuracy vs a 0.50
   majority baseline. Visualise the decision boundaries on a lat/long plot.
3. Clustering: run k-means or DBSCAN on ``latitude``/``longitude`` (optionally weighted by
   population) and compare clusters with provinces.
4. Exploration: plot rank vs population on log-log axes to check Zipf's law for Pakistani
   cities, and discuss how the selection bias above affects the result.

**Citation / attribution:** GeoNames geographical database (https://www.geonames.org),
Pakistan export PK.zip and admin1CodesASCII.txt, retrieved 2026-11-29. Licensed under the
Creative Commons Attribution 4.0 License (https://creativecommons.org/licenses/by/4.0/).
Data provided "as is" without warranty or any representation of accuracy, timeliness or
completeness. Modified by pakdata: filtered to populated places with population > 0,
province names mapped from admin1 codes, log10 population and merged elevation column added.

Citation and attribution

GeoNames geographical database (https://www.geonames.org), Pakistan export PK.zip and admin1CodesASCII.txt, retrieved 2026-11-29. Licensed under the Creative Commons Attribution 4.0 License (https://creativecommons.org/licenses/by/4.0/). Data provided "as is" without warranty or any representation of accuracy, timeliness or completeness. Modified by pakdata: filtered to populated places with population > 0, province names mapped from admin1 codes, log10 population and merged elevation column added.

Packaged by pakdata (https://github.com/junaidaslam2006/pakData). Build script: scripts/build_pak_cities.py.

Downloads last month
17

Collection including junaid008/pak_cities