Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

converting pandas._libs.tslibs.timedeltas.Timedelta to days

# Convert TimeDelta column (5 days etc.) into an integer column (5)
import numpy as np
df.timeDelta = (df.timeDelta / np.timedelta64(1,'D')).astype(int)
Comment

converting pandas._libs.tslibs.timedeltas.Timedelta to days

# Convert TimeDelta column (5 days etc.) into an integer column (5)
import numpy as np
df['timeDelta'] = (df['timeDelta'] / np.timedelta64(1,'D')).astype(int)
Comment

PREVIOUS NEXT
Code Example
Python :: panda check a cell value is not a number 
Python :: dataframe to dictionary with one column as key 
Python :: multiple input in python 
Python :: get all values of a dict python 
Python :: generate all parameters combination python 
Python :: get rid of n in string python 
Python :: how to roll longitude axis 
Python :: time counter in python 
Python :: join two numpy arrays 
Python :: delete index in elasticsearch python 
Python :: how to log ip addresses in django 
Python :: pandas load dataframe without header 
Python :: how do i create a file in specific folder in python 
Python :: python datetime date only 
Python :: quit button tkinter 
Python :: python is integer 
Python :: list of strings to numbers python 
Python :: remove all zeros from list python 
Python :: django validator min max value 
Python :: how to say hello world in python 
Python :: how to keep columns in pandas 
Python :: how to slice dataframe based on daterange in pandas 
Python :: how to add row in spark dataframe 
Python :: iris dataset python import 
Python :: copy a file from one directroy to other using python 
Python :: find rows in dataframe from another dataframe python 
Python :: difference between sort and sorted 
Python :: clear python list 
Python :: python count hex 
Python :: extract minutes from timedelta python 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =