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'
Remove elements of one list from another list using “while”
Hosting Bokeh Server with Tornado on AWS
Functions that help to understand json(dict) structure
Scapy How converting hex to new packet
Write and read test files in dictionary format
Python 3.x Connect to account with request POST
AttributeError: module 'networkx' has no attribute 'Graph'
How to exclude selected domains from python crawl script in google search
Python - Py2exe error
Anaconda import packages from another environment
How to Drag & Drop Multiple rows of a QTableView in pyqt5
Handle prompts in Python - popen
How to create an infinite iterator to generate an incrementing alphabet pattern?
Python RTMP Authenticiation Script
How to change background colour in Kivy
Is it correct to use kwargs in the following scenario of python code?