2016-06-27 14 views
1

私は、ドキュメントに記載されているパンダの時間/日付コンポーネントを使って遊んできました。私は、http://pandas.pydata.org/pandas-docs/stable/timeseries.html#time-date-componentsと記載されている時間/日付コンポーネントに気付きました。そのうちのいくつかはプロパティであり、例:パンダタイムスタンプのコンポーネント - 一部はプロパティであり、一部はメソッドです。

output

コンポーネントのプロパティであるとし、方法であるドキュメントでは、このための説明および/または全体的なロジックはありますか?

答えて

1

私はあなたの例を参照している場合、その後:

pd.Timestamp 

はプロパティです。直接的なパンダの操作は、パンダのプロパティです。これらのプロパティで

In [4]: pd. 
Display all 158 possibilities? (y or n) 
pd.Categorical   pd.SparseTimeSeries  pd.ewmvol    pd.io     pd.read_excel   pd.rolling_sum 
pd.CategoricalIndex  pd.Term     pd.expanding_apply  pd.isnull    pd.read_fwf    pd.rolling_var 
pd.DataFrame    pd.TimeGrouper   pd.expanding_corr  pd.json     pd.read_gbq    pd.rolling_window 
pd.DateOffset   pd.TimeSeries   pd.expanding_count  pd.lib     pd.read_hdf    pd.scatter_matrix 
pd.DatetimeIndex   pd.Timedelta    pd.expanding_cov   pd.lreshape    pd.read_html    pd.set_eng_float_format 
pd.ExcelFile    pd.TimedeltaIndex  pd.expanding_kurt  pd.match     pd.read_json    pd.set_option 
pd.ExcelWriter   pd.Timestamp    pd.expanding_max   pd.melt     pd.read_msgpack   pd.show_versions 
pd.Expr     pd.WidePanel    pd.expanding_mean  pd.merge     pd.read_pickle   pd.sparse 
pd.Float64Index   pd.algos     pd.expanding_median  pd.missing_dependencies pd.read_sas    pd.stats 
pd.Grouper    pd.bdate_range   pd.expanding_min   pd.msgpack    pd.read_sql    pd.test 
pd.HDFStore    pd.compat    pd.expanding_quantile pd.notnull    pd.read_sql_query  pd.timedelta_range 
pd.Index     pd.computation   pd.expanding_skew  pd.np     pd.read_sql_table  pd.to_datetime 
pd.IndexSlice   pd.concat    pd.expanding_std   pd.offsets    pd.read_stata   pd.to_msgpack 
pd.Int64Index   pd.core     pd.expanding_sum   pd.ols     pd.read_table   pd.to_numeric 
pd.MultiIndex   pd.crosstab    pd.expanding_var   pd.option_context  pd.reset_option   pd.to_pickle 
pd.NaT     pd.cut     pd.factorize    pd.options    pd.rolling_apply   pd.to_timedelta 
pd.Panel     pd.date_range   pd.fama_macbeth   pd.ordered_merge   pd.rolling_corr   pd.tools 
pd.Panel4D    pd.datetime    pd.get_dummies   pd.pandas    pd.rolling_count   pd.tseries 
pd.Period    pd.datetools    pd.get_option   pd.parser    pd.rolling_cov   pd.tslib 
pd.PeriodIndex   pd.dependency   pd.get_store    pd.period_range   pd.rolling_kurt   pd.unique 
pd.RangeIndex   pd.describe_option  pd.groupby    pd.pivot     pd.rolling_max   pd.util 
pd.Series    pd.eval     pd.hard_dependencies  pd.pivot_table   pd.rolling_mean   pd.value_counts 
pd.SparseArray   pd.ewma     pd.hashtable    pd.plot_params   pd.rolling_median  pd.wide_to_long 
pd.SparseDataFrame  pd.ewmcorr    pd.index     pd.pnow     pd.rolling_min   
pd.SparseList   pd.ewmcov    pd.indexes    pd.qcut     pd.rolling_quantile  
pd.SparsePanel   pd.ewmstd    pd.infer_freq   pd.read_clipboard  pd.rolling_skew   
pd.SparseSeries   pd.ewmvar    pd.info     pd.read_csv    pd.rolling_std   

さらにドリルダウン操作はメソッドです:

以下は、いくつかの可能性があります。あなたの例から

t.dayofweek 

t.weekday 

はメソッドです。

関連する問題