MCPcopy Index your code
hub / github.com/clips/pattern / copy

Method copy

pattern/db/__init__.py:1860–1870  ·  view source on GitHub ↗

Returns a new Datasheet from a selective list of row and/or column indices.

(self, rows=ALL, columns=ALL)

Source from the content-addressed store, hash-verified

1858 return Datasheet(rows=[list.__getitem__(self, i)[j:j+m] for i in range(i, i+n)])
1859
1860 def copy(self, rows=ALL, columns=ALL):
1861 """ Returns a new Datasheet from a selective list of row and/or column indices.
1862 """
1863 if rows == ALL and columns == ALL:
1864 return Datasheet(rows=self)
1865 if rows == ALL:
1866 return Datasheet(rows=zip(*(self.columns[j] for j in columns)))
1867 if columns == ALL:
1868 return Datasheet(rows=(self.rows[i] for i in rows))
1869 z = zip(*(self.columns[j] for j in columns))
1870 return Datasheet(rows=(z[i] for i in rows))
1871
1872 @property
1873 def json(self):

Callers 3

__add__Method · 0.95
test_sliceMethod · 0.95
test_copyMethod · 0.95

Calls 2

DatasheetClass · 0.85
zipFunction · 0.85

Tested by 2

test_sliceMethod · 0.76
test_copyMethod · 0.76