资源描述
PythonWordCloudPythonWord CloudWhatiswordcloud?What is word cloud?2Whatiswordcloud?Atagcloud(wordcloud,orweightedlistinvisualdesign)isavisualrepresentationoftextdata,typicallyusedtodepictkeywordmetadata(元数据)(tags)onwebsites,ortovisualizefreeformtext.Tagsareusuallysinglewords,andtheimportanceofeachtagisshownwithfontsizeorcolor.Thisformatisusefulforquicklyperceivingthemostprominenttermsandforlocatingatermalphabeticallytodetermineitsrelativeprominence.Whenusedaswebsitenavigationaids,thetermsarehyperlinkedtoitemsassociatedwiththetag.What is word cloud?A tag cloud3Forwhat?Atextcloudorwordcloudisavisualizationofwordfrequencyinagiventextasaweightedlist.Thetechniquehasrecentlybeenpopularlyusedtovisualizethetopicalcontentofpoliticalspeeches.For what?A text cloud or word4CreationInprinciple,thefontsizeofataginatagcloudisdeterminedbyitsincidence.Forawordcloudofcategorieslikeweblogs,frequency,forexample,correspondstothenumberofweblogentriesthatareassignedtoacategory.Forsmallerfrequenciesonecanspecifyfontsizesdirectly,fromonetowhateverthemaximumfontsize.Forlargervalues,thereisaalgorithm.CreationIn principle,the font5DownloadtextWritecodeCutthemSplitwordsTransformtextintolistCountthewordsCountwordfrequencyPrepareapictureUseapackageRunitVisualize Fundamental stepsSplit wordsDownload textWrite 6SplitwordsDownloadtext(orcopy)Split wordsDownload text7SplitwordsUseapackagenamedjiebaSplit wordsUse a package name8CountwordfrequencySoeasy!Count word frequencySo easy!9VisualizeBeforeAfterVisualize Before After 10WordcloudWord cloud11BasisonthepopulationofcountryBasis on the population of cou12词云图-展示ppt课件13Thats all!Thats all!Thats all!14
展开阅读全文