Skip to content

Commit 20096ec

Browse files
committed
fix #804 : removed trailing NaNs and None values when extracting Axis and Group objects from __axes__ and __groups__ special sheets/csv files
1 parent 26ab2ba commit 20096ec

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

doc/source/changes/version_0_32.rst.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,6 @@ Fixes
5757

5858
* fixed reading/exporting sessions containing two or more axes/groups
5959
with the same name (or anonymous) from/to CSV, Excel and HDF files (closes :issue:`803`).
60+
61+
* fixed NaNs and None labels appearing in axes and groups when reading/exporting sessions
62+
from/to CSV and Excel files (closes :issue:`804`).

larray/inout/pandas.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ def _axis_to_series(key, axis, dtype=None):
345345

346346
def _series_to_axis(series):
347347
name = str(series.name)
348+
series = series.loc[:series.last_valid_index()]
348349
if ':' in name:
349350
key, axis_name = name.split(':')
350351
else:
@@ -366,6 +367,7 @@ def _series_to_group(series, axes):
366367
if group_name == 'None':
367368
group_name = None
368369
axis = axes[axis_name]
370+
series = series.loc[:series.last_valid_index()]
369371
return key, LGroup(key=series.values, name=group_name, axis=axis)
370372

371373

0 commit comments

Comments
 (0)