浠嶦xcel閲岄潰璇绘暟鎹殑鏃跺?檖ython鎶ラ敊TypeError: float object is not iterable
float鏄诞鐐规暟鎹被鍨嬩笉鏄彲杩唬瀵硅薄,鍦?2琛屼腑鐨剅ow_ydata杩欎釜鍙橀噺鏄诞鐐规暟鎹被鍨?搴旇鍓嶉潰鏈夐棶棰樺惂,娴偣绫诲瀷鏈韩灏辨病娉曡凯浠d笉鏄釜瀹瑰櫒
鏇村杩介棶杩界瓟
浣犲ソ锛岃繖宸茬粡鏄暣涓簮绋嬪簭浜嗭紝鍓嶉潰灏辨槸涓?浜涘紩鍏ュ簱鐨勶紝鍚庨潰灏辨槸杩愯杩欎釜鍑芥暟锛屼綘鑳藉府蹇欑湅涓?涓嬫?庝箞鏀瑰悧锛岃兘鎶奅xcel閲岄潰鐨勬暟鎹鍒板垱寤虹殑涓や釜鍒楄〃閲屽氨琛岋紝涓囧垎鎰熻阿锛?/p>
浣犵粰鐨勫彧鏄釜鑷畾涔夊嚱鏁?杩樻湁鎶ラ敊鐣岄潰,杩愯鐨勭▼搴忛兘娌℃湁鍛?..............
鐪嬩綘鎶ラ敊鐨勯潰鏉垮氨鏄繖涓剰鎬?浣犲洖鍘绘壘鍛?
浣犺繖鎶ラ敊鐣岄潰鏄繖涓剰鎬?浣犲嚱鏁拌皟鐢ㄦ椂鍊欏嚭閿?浣犺鎶?2琛屽啓鐨勫唴瀹瑰彂鍑烘潵鎵嶅鑰屼笉鏄嚜瀹氫箟鍑芥暟杩欎釜,鏄?2琛屼綘鐢熸垚row_ydata鐨勬椂鍊欒繖涓彉閲忕敓鎴愭湁闂,浣犲彲浠ュ湪22琛屽墠print(row_ydata)鐪嬬湅杩欎釜鍙橀噺
涓嶆槸寰堟噦浣犵殑鎰忔?濆晩銆傘?傝繖涓凡缁忔槸鍏ㄩ儴绋嬪簭浜嗭紝杩樻湁杩愯鐣岄潰锛堟姤閿欎簡杩愯涓嶄簡锛夌洰鏍囨槸鎶奅xcel鏌愪竴鍒楅噷闈㈢殑鏁版嵁璇诲埌涓?涓垪琛ㄩ噷闈紝鐒跺悗鎶ラ敊float鏁版嵁涓嶈兘杩唬銆傘??/p>
Excel琛ㄤ篃鍦ㄨ繖閲屼簡馃槶馃槶
棣栧厛浣犳墦寮?xls涓轰粈涔堣鐢╫pen,
浣犱笉搴旇鏄?/p>
importpandasaspd
df=pd.read_excel(琛ㄦ牸鐨勮矾寰?)
鐒跺悗杩涜df鍙栧?艰繘琛屾搷浣?/p>
python鏈熸湯鑰冨彲浠ヤ綔寮婂悧
浠讳綍鏈熸湯鑰冭瘯閮芥槸绂佹浣滃紛鐨勶紝鍖呮嫭python锛屼綔寮婄殑鍚庢灉寰堜弗閲嶏紝浣滃紛琚煡鍑哄悗璇ヨ绋嬭?冩牳鎴愮哗璁颁负鏃犳晥锛屽苟搴旇鍏惰繚绾垨鑰呬綔寮婃儏鑺傛潵澶勭綒锛屾渶楂樺彲浠ュ紑闄ゅ绫嶃??/p>
鑰冭瘯浣滃紛琛屼负鏄寚鍦ㄧ洃鑰冭?呴?氳繃涔﹂潰銆佸彛澶存彁闂垨瀹為檯鎿嶄綔绛夋柟寮忚?冩煡鍙傝瘯鑰呮墍鎺屾彙鐨勭煡璇嗗拰鎶?鑳芥椂锛屽弬璇曡?呴?氳繃涓嶆褰撻?斿緞鍙傝瘯銆佽?冩牳杩囩▼涓湪鑰冩牳涓嶅厑璁哥殑鑼冨洿鍐呭姹傛垨鑰呰瘯鍥惧姹傜瓟妗堬紝涓庡叕骞炽?佸叕姝e師鍒欑浉鎮栫殑琛屼负銆?/p>
姹傚ぇ绁炶В绛旇繖涓狿ython绋嬪簭鍜嬪啓锛屾垜鐨勫ぇ涓?鏈熸湯浣滀笟锛屾嫓鎵樺ぇ绁炰簡锛屽彲浠ュ姞Q缁欎竴瀹氭姤閰殑锛屾眰璇︾粏鏁欐垜
鎶婁笅闈㈢殑浠g爜瀛樻垚py鏂囦欢杩愯灏卞ソ鍟︺?傝繍琛岀粨鏋滃鎴浘銆俰mport random def givemecoinSIde():result = [apply(lambda: random.choice(["front", "verso"])) for x in xrange(99)]return "front times: %s, verso times: %s" % (len([x for x in result if x == "front"]), len([x for x in result if x == "verso"])) if __name__ == __main__:print givemecoinside()
鏈熸湯JAVA缂栫▼
娓ゅぇ鏄摢鐨勫鏍℃病鍚杩囷紝杩欓濂藉儚鏄寳浜ぇ瀛﹀嚭鐨凜璇█棰?/p>