Skip to content

Commit

Permalink
Merge pull request #103 from Roche/dev
Browse files Browse the repository at this point in the history
version 1.0.8
  • Loading branch information
ofajardo authored Jan 8, 2021
2 parents dbcaeb0 + 8dbcafe commit 0c1c9d5
Show file tree
Hide file tree
Showing 13 changed files with 989 additions and 763 deletions.
3 changes: 3 additions & 0 deletions change_log.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.0.8 (github, pypi and conda 2021.01.09)
* fixing order of categories

# 1.0.7 (github, pypi and conda 2021.01.09)
* Added formats_as_ordered_category to get an ordered category.
* Added value_formats in order to be able to set the variable format
Expand Down
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 1a49789c316ca66f9eda1c9c11bf6954
config: 7784f3b8d021cf9864d8ed0b1871b3d1
tags: 645f666f9bcd5a90fca523b33c5a78b7
2 changes: 1 addition & 1 deletion docs/_build/html/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '1.0.7',
VERSION: '1.0.8',
LANGUAGE: 'None',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Index &mdash; pyreadstat 1.0.7 documentation</title>
<title>Index &mdash; pyreadstat 1.0.8 documentation</title>



Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Welcome to pyreadstat’s documentation! &mdash; pyreadstat 1.0.7 documentation</title>
<title>Welcome to pyreadstat’s documentation! &mdash; pyreadstat 1.0.8 documentation</title>



Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/py-modindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Python Module Index &mdash; pyreadstat 1.0.7 documentation</title>
<title>Python Module Index &mdash; pyreadstat 1.0.8 documentation</title>



Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Search &mdash; pyreadstat 1.0.7 documentation</title>
<title>Search &mdash; pyreadstat 1.0.8 documentation</title>



Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = '1.0.7'
release = '1.0.8'


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion pyreadstat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
from .pyreadstat import read_file_in_chunks, read_file_multiprocessing
from ._readstat_parser import ReadstatError, metadata_container

__version__ = "1.0.7"
__version__ = "1.0.8"
1,720 changes: 968 additions & 752 deletions pyreadstat/pyreadstat.c

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions pyreadstat/pyreadstat.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,15 @@ def set_value_labels(dataframe, metadata, formats_as_category=True, formats_as_o
if var_name in df_copy.columns:
df_copy[var_name] = df_copy[var_name].apply(lambda x: labels.get(x, x))
if formats_as_ordered_category:
categories = list(labels.values())
categories.sort()
categories = list(set(labels.values()))
original_values = list(labels.keys())
original_values.sort()
revdict= dict()
for orival in original_values:
curcat = labels.get(orival)
if not revdict.get(curcat):
revdict[curcat] = orival
categories.sort(key=revdict.get)
df_copy[var_name] = pd.Categorical(
df_copy[var_name],
ordered = True,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@

setup(
name='pyreadstat',
version='1.0.7',
version='1.0.8',
description=short_description,
author="Otto Fajardo",
author_email="pleasecontactviagithub@notvalid.com",
Expand Down

0 comments on commit 0c1c9d5

Please sign in to comment.