You can use pd.DateOffset:
test[1].index + pd.DateOffset(hours=16)
pd.DateOffset
accepts the same keyword arguments as dateutil.relativedelta.
The problem you encountered was due to this bug which has been fixed in Pandas version 0.14.1:
In [242]: pd.to_timedelta(16, unit="h")
Out[242]: numpy.timedelta64(16,'ns')
If you upgrade, your original code should work.
Related Contents:
- How are iloc and loc different?
- How to convert index of a pandas dataframe into a column
- Selecting a row of pandas series/dataframe by integer index
- How to reset index in a pandas dataframe? [duplicate]
- Get column index from column name in python pandas
- pandas: multiple conditions while indexing data frame – unexpected behavior
- Python Pandas: Get index of rows where column matches certain value
- What rules does Pandas use to generate a view vs a copy?
- Pandas split DataFrame by column value
- Apply Function on DataFrame Index
- Forcing pandas .iloc to return a single-row dataframe?
- start index at 1 for Pandas DataFrame
- Accessing Pandas column using squared brackets vs using a dot (like an attribute)
- Select only one index of multiindex DataFrame
- pandas – change df.index from float64 to unicode or string
- Pandas – Compute z-score for all columns
- Pandas (python): How to add column to dataframe for index?
- In Python pandas, start row index from 1 instead of zero without creating additional column
- Set MultiIndex of an existing DataFrame in pandas
- Accessing a Pandas index like a regular column
- Pandas Resampling error: Only valid with DatetimeIndex, TimedeltaIndex or PeriodIndex
- Pandas finding local max and min
- obtaining last value of dataframe column without index
- Pandas KeyError: value not in index
- Pandas compare next row
- Selecting last n columns and excluding last n columns in dataframe
- Convert Pandas column containing NaNs to dtype `int`
- How to plot two columns of a pandas data frame using points
- ValueError: Length of values does not match length of index | Pandas DataFrame.unique()
- Get the name of a pandas DataFrame
- Pandas – Filtering None Values
- Good alternative to Pandas .append() method, now that it is being deprecated?
- Resampling Within a Pandas MultiIndex
- Calculate time difference between Pandas Dataframe indices
- Running get_dummies on several DataFrame columns?
- Using .loc with a MultiIndex in pandas
- Filtering all rows with NaT in a column in Dataframe python
- Pandas DataFrame Add column to index without resetting
- python pandas dataframe slicing by date conditions
- Max and Min date in pandas groupby
- Calculate summary statistics of columns in dataframe
- Apply CSS class to Pandas DataFrame using to_html
- Split cell into multiple rows in pandas dataframe
- Remove name, dtype from pandas output of dataframe or series
- python pandas pivot_table count frequency in one column
- How to resample a dataframe with different functions applied to each column?
- Convert month int to month name in Pandas
- Python pandas: output dataframe to csv with integers
- Pandas: create dataframe from list of namedtuple
- Select certain rows by index of another DataFrame