From 980673644055b85dcb297c5cb0e1947d0d075fc9 Mon Sep 17 00:00:00 2001 From: amnona Date: Mon, 17 Dec 2018 05:50:01 +0200 Subject: [PATCH] use None as default for Experiment optional mutable (#139) --- calour/experiment.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/calour/experiment.py b/calour/experiment.py index fc2c599e..bd743452 100644 --- a/calour/experiment.py +++ b/calour/experiment.py @@ -81,10 +81,14 @@ class Experiment: AmpliconExperiment ''' def __init__(self, data, sample_metadata, feature_metadata=None, - exp_metadata={}, description='', sparse=True): + exp_metadata=None, description='', sparse=True): self.data = data self.sample_metadata = sample_metadata + if feature_metadata is None: + feature_metadata = pd.DataFrame(np.arange(data.shape[1])) self.feature_metadata = feature_metadata + if exp_metadata is None: + exp_metadata = {} self.exp_metadata = exp_metadata self.description = description self.normalized = 0