Skip to content
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

EnsembleSeries display #591

Merged
merged 2 commits into from
Jun 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions pyleoclim/core/ensembleseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ class EnsembleSeries(MultipleSeries):
and visualization (e.g., envelope plot) that are unavailable to other classes.

'''

def __init__(self, series_list, label=None):
for i, ts in enumerate(series_list):
if ts.label is None:
series_list[i].label = f"#{i}" # assign labels if missing
self.series_list = series_list
self.label = label

Expand Down Expand Up @@ -1376,15 +1380,15 @@ def to_dataframe(self, axis = 'value'):

if axis == 'value':
for ts in self.series_list:
if ts.label is None:
if ts.label is None: # should no longer be necessary now that it's done in __init__
df_dict[idx]=ts.value
else:
df_dict[ts.label]=ts.value
idx+=1

elif axis == 'time':
for ts in self.series_list:
if ts.label is None:
if ts.label is None: # should no longer be necessary now that it's done in __init__
df_dict[idx]=ts.time
else:
df_dict[ts.label]=ts.time
Expand Down
Loading