String formatting of timedeltas in Pandas
I noticed that Pandas knows how to smartly format a timedelta object into a string. In : df[column][rows].max() Out: 0 2 days, 02:08:07 dtype: timedelta64[ns] When I try to do this manually I keep getting the string in nanoseconds. In : df[column][rows].max() Out: numpy.timedelta64(180487000000000,'ns') In : str(df[column][rows].max()) Out: '180487000000000 nanoseconds' I would rather not reinvent the wheel, so is there any way to access the string formatting method (or the string itself) that Pandas uses to show a timedelta object in x days, hh:mm:ss ?
The function is located here: pd.tslib.repr_timedelta64 In action: In : pd.tslib.repr_timedelta64(np.timedelta64(180487000000000,'ns')) Out: '2 days, 02:08:07'
Multiple foreign key fields in abstract Django class
How to convert the value_list to list in Django
Implicit Differentiation Sympy
Why does pygame stop working when I remove a print statement?
Interact with an interactive shell script on python
Need help connecting to SQL Server from Python Flask-Appbuilder
pyspark : Convert DataFrame to RDD[string]
Docker and single python file
Passing user inputs directly in python
Django Generic Foreign Key Sorting
Python prime listing repetition bug
Summing values of a pandas data frame given a list of columns [duplicate]
Why is the top level package being removed? Python
List of objects function not working
multiple assignments in one line for loop python
selenium unicode encode error