During the Edo period, Kyoto was organized into autonomous administrative units called 'machigumi,' composed of local residents; however, at or about the time of the Meiji Restoration, the machigumi were reorganized under a system in which they were designated as belonging to either the northern part of Kyoto, 'Kamigyo,' or the southern part, 'Shimogyo,' followed by bangumi number, such as 'Kamigyo, bangumi number 12,' and were referred to as 'bangumi' from that point.
近世、京都には「町組」という住民自治の組織があったが、明治維新の前後に、町組は「上京（下京）第○○番組」という通し番号のついた地域的なまとまりを持つ組織に再編され、「番組」と呼ばれるようになった。