The gravitational instability of a filamentary molecular cloud in non-ideal magnetohydrodynamics is investigated. The filament is assumed to be in hydrostatic equilibrium. We add the effect of ambipolar diffusion to the filament which is threaded by an initial uniform axial magnetic field along its axis. We write down the fluid equations in cylindrical coordinates and perform linear perturbation analysis. We integrate the resultant differential equations and then derive the numerical dispersion relation. We find that a more efficient ambipolar diffusion leads to an enhancement of the growth of the most unstable mode, and to the increase of the fragmentation scale of the filament.