带你一起盘点,Pandas1.0的主要功能
>>> C = pd.Series([False, True, False], dtype="bool") >>> df.B = B, df.C = C >>> df.info() <class 'pandas.core.frame.DataFrame'> RangeIndex: 3 entries, 0 to 2 Data columns (total 3 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 A 3 non-null int64 1 B 3 non-null string 2 C 3 non-null bool dtypes: int64(1), object(1), string(1) memory usage: 200.0+ bytes 留意Dtype列此刻怎样回响新范例的string和bool。 新字符串dtype最适用的上风在于,可以从DataFrame中选择string列。这样可以更快地仅对数据集的文本因素举办说明。 df.select_dtypes("string") 早年,只能通过显式行使其名称来选择string范例列。 从本日开始,把握Pandas 1.0的首要成果,全新优化开启行使吧~ (编辑:湖南网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |