The invention provides a method for purifying water quality by using pennisetum purpureum and an ecological floating bed applying the method. The pennisetum purpureum is planted on the ecological floating bed, and is used for absorbing, adsorbing, retaining and degrading contaminant through growth, so as to realize the purification of water quality. The method specifically comprises the steps of winding the stem base of a pennisetum purpureum cutting with a sponge bar absorbing enough water, fixing in a flower pot, placing the flower pot with plants in planting holes distributed along the water level of an water edge through a pot transferring device, when the pennisetum purpureum grows to 1 to 1.3m in height, reserving stubble with the length of 5 to 6cm and cradling. The ecological floating bed designed for the method consists of PVC (polyvinyl chloride) pipes and PS extruded sheets, and has the advantages of being wind and wave-resistant, antioxidant, extrusion resistant, long in service life, low-cost and the like. According to the method provided by the invention, the characteristics of large biomass, quick growth, developed root systems, cradle resistance and the like, and feeding and electricity generation functions of the pennisetum purpureum are utilized, and by applying the pennisetum purpureum into an ecological floating bed system, not only can water quality be effectively purified, but also economic output can be realized, so that the method is worthy of large-scale promotion.