Error while deleting/dropping a series/dataframe entry with timezone aware timestamps.
See original GitHub issueCode Sample, a copy-pastable example if possible
import pandas as pd
start = pd.Timestamp('20170101', tz='Europe/Berlin')
end = pd.Timestamp('20180101', tz='Europe/Berlin')
index = pd.date_range(start, end, freq='15min')
data = [1 for x in range(len(index))]
series = pd.Series(index=index, data=data)
dataframe = pd.DataFrame(series)
timestamp = pd.Timestamp('201701011515', tz='Europe/Berlin')
# Working
series[timestamp]
dataframe.loc[timestamp]
# Errors
del series[timestamp]
dataframe.drop(timestamp)
series.drop(timestamp)
Problem description
It not possible to delete/drop a series/dataframe entry with timezone aware timestamps, while accessing them is possible.
Expected Output
Deletion of the respective entry.
Output of pd.show_versions()
INSTALLED VERSIONS
------------------
commit: None
python: 3.6.4.final.0
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: Intel64 Family 6 Model 142 Stepping 9, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: None.None
pandas: 0.23.1
pytest: 3.6.2
pip: 10.0.1
setuptools: 39.2.0
Cython: None
numpy: 1.14.5
scipy: 1.1.0
pyarrow: None
xarray: None
IPython: 6.4.0
sphinx: None
patsy: None
dateutil: 2.7.3
pytz: 2018.5
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 2.2.2
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: None
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7 (4 by maintainers)
Top Results From Across the Web
How to remove timezone from a Timestamp column in a ...
The column must be a datetime dtype, for example after using pd.to_datetime . Then, you can use tz_localize to change the time zone, ......
Read more >Time series / date functionality — pandas 1.5.2 documentation
Date times: A specific date and time with timezone support. ... Pass errors='ignore' to return the original input when unparsable:.
Read more >How to remove timezone from a Timestamp ... - GeeksforGeeks
In this article, we are going to see how to remove timezone from a Timestamp column in a pandas dataframe. Creating dataframe for...
Read more >dask.dataframe.to_datetime - Dask documentation
When another datetime conversion error happens. For example when one of 'year', 'month', day' columns is missing in a DataFrame , or when...
Read more >Pandas convert unix timestamp to datetime with timezone
To convert UNIX timestamp to datetime, use Pandas to_datetime (~) method. ... Timezone-naive inputs will remain naive, while timezone-aware ones will keep ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was able to reproduce this issue with
master
’s code. I have just installedpandas
for development withanaconda
as outlined here and received the following output when I ran the code:I would like to attempt to fix this issue, if possible.
I’m also able to reproduce.
On Mon, Jul 9, 2018 at 3:15 AM, elboerto notifications@github.com wrote: