Skip to content

ENH: Categorical serialized #7621

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
3 of 4 tasks
jankatins opened this issue Jun 30, 2014 · 5 comments
Closed
3 of 4 tasks

ENH: Categorical serialized #7621

jankatins opened this issue Jun 30, 2014 · 5 comments
Labels
Categorical Categorical Data Type Enhancement IO HDF5 read_hdf, HDFStore

Comments

@jankatins
Copy link
Contributor

jankatins commented Jun 30, 2014

Currently df which include a categorical can be written to a hdf store and other on disc storage formats. For formats which include factors/categoricals, also ensure that such data is read into a categorical.

@jankatins
Copy link
Contributor Author

For discussion on this, see #7217 and #7444 and also the tests in test_categorical (test_io_hdf, test_io_csv)

@jreback jreback added this to the 0.15.0 milestone Jun 30, 2014
@jreback jreback changed the title Categorical: ensure that categoricals will be written to disc ENH: Categorical serialized Oct 25, 2014
@fkaufer
Copy link

fkaufer commented Oct 27, 2014

Stata
Categorical export could be implemented using value labels, see http://www.stata.com/help.cgi?dta. As the name already indicates Stata's value labels are not as generic as pandas' categoricals but limited to strings (similar to R).

Support for categoricals-to-value-labels-conversion would be fantastic, but I would already be happy, if category dtype is captured (pandas/io/stata.py#L1262) and coerced to string. Guess this requires also to either fix to_records for categoricals (pandas/io/stata.py#L1633, #8626) or to explicitely decode (#8628) on the fly.

@jreback
Copy link
Contributor

jreback commented Oct 27, 2014

cc @bashtage, interested?

@bashtage
Copy link
Contributor

I'll have to take a look at how hard it will be - haven't used Categoricals, so extra hurdle.

bashtage added a commit to bashtage/pandas that referenced this issue Nov 12, 2014
Add support for exporting DataFrames containing categorical data.

closes pandas-dev#8633
xref pandas-dev#7621
@jreback jreback modified the milestones: 0.16.0, Next Major Release Mar 6, 2015
@jreback
Copy link
Contributor

jreback commented Jul 6, 2018

closing, you cannot directly serialize a Categroical in csv, but you can specify the dtype when reading.

@jreback jreback closed this as completed Jul 6, 2018
@jreback jreback modified the milestones: Contributions Welcome, No action Jul 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Categorical Categorical Data Type Enhancement IO HDF5 read_hdf, HDFStore
Projects
None yet
Development

No branches or pull requests

4 participants