在生成第三個(gè)表格時(shí)報(bào)錯(cuò)是怎么回事?
?df=pd.DataFrame({"A":1,"B":pd.Timestamp("20170301","C":pd.Series(1,index=list(range(4)),dtype="float32"),"D":np.array([3]*4,dtype="float32"),"E":pd.Categorical(["police","student","teacher","doctor"])})? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^
SyntaxError: invalid syntax
"C":pd.Series(1,index=list(range(4)),dtype="float32"),一段顯示“variables annotation cannot be combined with tuple unpacking”
2019-09-11
建議在pycharm里編寫,方便debug
很明顯你的這段代碼是在這里有錯(cuò):
應(yīng)該修改為:
建議用pycharm編寫,方便debug
這一段正確的代碼應(yīng)該是這樣的: