python計(jì)時(shí)器代碼 Python中Pandas時(shí)間加減如何表示?
Python中Pandas時(shí)間加減如何表示?使用DataFrame查看數(shù)據(jù)(類似SQL中的select):frompandasimportDataFrame#從pandas庫(kù)中引用DataFramed
Python中Pandas時(shí)間加減如何表示?
使用DataFrame查看數(shù)據(jù)(類似SQL中的select):frompandasimportDataFrame#從pandas庫(kù)中引用DataFramedf_obj=DataFrame()#創(chuàng)建DataFrame對(duì)象df_obj.dtypes#查看各行的數(shù)據(jù)格式df_obj.head()#查看前幾行的數(shù)據(jù),默認(rèn)前5行df_obj.tail()#查看后幾行的數(shù)據(jù),默認(rèn)后5行df_obj.index#查看索引df_obj.columns#查看列名df_obj.values#查看數(shù)據(jù)值df_obj.describe#描述性統(tǒng)計(jì)df_obj.T#轉(zhuǎn)置df_obj.sort(columns=‘’)#按列名進(jìn)行排序df_obj.sort_index(by=[‘’,’’])#多列排序,使用時(shí)報(bào)該函數(shù)已過(guò)時(shí),請(qǐng)用sort_valuesdf_obj.sort_values(by=["",""])同上!