Commit eb6a9f69a9e45a2df01ba8f70c7ea47311ace435

  • avatar
  • Luca Beltrame <einar @bi…1.(none)> (Committer)
  • Fri Sep 04 15:52:17 CEST 2009
  • avatar
  • Luca Beltrame (Author)
  • Thu Sep 03 09:36:27 CEST 2009
License change - GPL 2+
README
(2 / 1)
  
1111------------------------------------------------------------------------------
1212
1313This program is distributed under the terms of the GNU General Public License
14(GPL), version 2. This means that you can freely modify, copy and distribute
14(GPL), version 2, or (at your option), any later version.
15This means that you can freely modify, copy and distribute
1516the program, under the terms of said license. The COPYING file gives a good
1617overview of what you can and can't do.
1718
  
44# (C) 2008 Luca Beltrame (einar at heavensinferno dot net)
55# (C) 2008 Giovanni Marco Dall'Olio (dalloliogm at gmail dot com)
66# This program is distributed under the terms of the GNU General Public
7# License (GPL), version 2. See the file COPYING for details.
7# License (GPL), version 2, or (at your option) any later version.
8# See the file COPYING for details.
89# ---------------------------------------------------------------------------
910
1011"Module providing a Pythonic implementation of a data.frame."
2020
2121__author__ = "Luca Beltrame"
2222__copyright__ = "Copyright 2008, Luca Beltrame, Giovanni Marco Dall'Olio"
23__license__ = "GPL (v2)"
23__license__ = "GPL (v2 or later)"
2424__version__ = "0.9-dev"
2525__status__ = "Development"
2626
644644
645645 return matrixApply(sourceMatrix, _mean,
646646 resultName="Mean value", what="rows")
647
648def transpose(matrix, identifier="x"):
649
650 """Transposes a DataMatrix object: rows become columns and vice versa. The
651 optional parameter ``identifier`` is passed as the resulting matrix's
652 identifer name."""
653
654 destination = EmptyMatrix(identifier = identifier,
655 row_names = matrix.columns)
656 for index in range(0, len(matrix.rownames)):
657 row_index = index + 1
658 column = matrix.getRow(row_index, row_name=False)
659 destination.append(column, matrix.rownames[index])
660
661 return destination
662
663def subset(matrix, column_list):
664
665 """Creates a new matrix with only a subset of the columns present, as
666 specified by the columns_list parameter."""
667
668 destination = EmptyMatrix(row_names=matrix.rownames,
669 identifier=matrix.identifier)
670 for column in column_list:
671 if column in matrix:
672 destination.append(matrix[column], column)
673
674 return destination
647675
648676def _test():
649677 import doctest
  
22License
33*******
44
5This program is distributed under the terms of the GNU General Public License (GPL), version 2. This means that you can freely modify, copy and distribute
6the program, under the terms of said license. The COPYING file gives a good overview of what you can and can't do.
5This program is distributed under the terms of the GNU General Public License (GPL), version 2, or (at your option), any later version. This means that you can freely modify, copy and distribute the program, under the terms of said license. The COPYING file gives a good overview of what you can and can't do.
76
87Although we hope that this program will be useful, it is without ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.