File tree Expand file tree Collapse file tree 1 file changed +40
-1
lines changed Expand file tree Collapse file tree 1 file changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -839,7 +839,46 @@ cdef class _Timedelta(timedelta):
839
839
840
840
@property
841
841
def resolution (self ):
842
- """ return a string representing the lowest resolution that we have """
842
+ """
843
+ Return a string representing the lowest timedelta resolution.
844
+
845
+ Each timedelta has a defined resolution that represents the lowest OR
846
+ most granular level of precision. Each level of resolution is
847
+ represented by a short string as defined below:
848
+
849
+ Resolution: Return value
850
+
851
+ * Days: 'D'
852
+ * Hours: 'H'
853
+ * Minutes: 'T'
854
+ * Seconds: 'S'
855
+ * Milliseconds: 'L'
856
+ * Microseconds: 'U'
857
+ * Nanoseconds: 'N'
858
+
859
+ Returns
860
+ -------
861
+ str
862
+ Timedelta resolution.
863
+
864
+ Examples
865
+ --------
866
+ >>> td = pd.Timedelta('1 days 2 min 3 us 42 ns')
867
+ >>> td.resolution
868
+ 'N'
869
+
870
+ >>> td = pd.Timedelta('1 days 2 min 3 us')
871
+ >>> td.resolution
872
+ 'U'
873
+
874
+ >>> td = pd.Timedelta('2 min 3 s')
875
+ >>> td.resolution
876
+ 'S'
877
+
878
+ >>> td = pd.Timedelta(36, unit='us')
879
+ >>> td.resolution
880
+ 'U'
881
+ """
843
882
844
883
self ._ensure_components()
845
884
if self ._ns:
You can’t perform that action at this time.
0 commit comments