Carbon monoxide electroreduction (COER) has been a key part of tandem electrolysis of carbon dioxide (CO2), in which searching for high catalytic performance COER electrocatalysts remains a great challenge. Herein, by means of density functional theory (DFT) computations, we explored the potential of a series of transition metal atoms anchored on N-doped γ-graphyne (TM@N-GY, TM from Ti to Au) as the COER electrocatalysts. We found that the final product selectivity of these single-atom catalysts depended on the position of the metal atom in the periodic table, with metals in the front and middle of each periodic period exhibiting high selectivity for CH4, while metals in the back producing CH3OH. Machine learning (ML) found that metal atomic number was intrinsic to the difference in COER performance of these single-atom catalysts (SACs). The free energy changes showed that Mn@N-GY and Ni@N-GY exhibited outstanding COER catalytic performance for producing CH4 and CH3OH, respectively. Our results provide theoretical and experimental guidance for designing efficient COER catalysts to generate C1 products.