Skip to content

merge_asof timeseries don't preserve categories Pandas 0.19.0 #14351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
existeundelta opened this issue Oct 5, 2016 · 2 comments
Closed

merge_asof timeseries don't preserve categories Pandas 0.19.0 #14351

existeundelta opened this issue Oct 5, 2016 · 2 comments
Labels
API Design Categorical Categorical Data Type Duplicate Report Duplicate issue or pull request

Comments

@existeundelta
Copy link

from the timeseries realease example: http://pandas.pydata.org/pandas-docs/version/0.19.0/whatsnew.html#merge-asof-for-asof-style-time-series-joining
making ticker as category:

trades.ticker = trades.ticker.astype('category') 
quotes.ticker = quotes.ticker.astype('category') 

merge = pd.merge_asof(trades, quotes,
                  on='time',
                  by='ticker')

Expected Output

merge.dtypes
Out[31]:
time datetime64[ns]
ticker category
price float64
quantity int64
bid float64
ask float64

geting :
time datetime64[ns]
ticker object
price float64
quantity int64
bid float64
ask float64

@chris-b1
Copy link
Contributor

chris-b1 commented Oct 5, 2016

Yes, this would be nice to support and is essentially a special case of #10409.

@chris-b1 chris-b1 added API Design Categorical Categorical Data Type labels Oct 5, 2016
@jreback jreback added the Duplicate Report Duplicate issue or pull request label Oct 5, 2016
@jreback jreback added this to the No action milestone Oct 5, 2016
@jreback
Copy link
Contributor

jreback commented Oct 5, 2016

xref this to the duplicate issue.

@jreback jreback closed this as completed Oct 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Categorical Categorical Data Type Duplicate Report Duplicate issue or pull request
Projects
None yet
Development

No branches or pull requests

3 participants