MCPcopy Create free account
hub / github.com/Lauriat/funct / squeeze

Method squeeze

funct/Array.py:987–995  ·  view source on GitHub ↗

Returns the Array with the same elements, but with outermost singleton dimension removed (if exists).

(self)

Source from the content-addressed store, hash-verified

985
986 @property
987 def squeeze(self):
988 """
989 Returns the Array with the same elements, but with
990 outermost singleton dimension removed (if exists).
991 """
992 if isinstance(self.headOption(), Array.__baseIterables) and self.length == 1:
993 return self[0]
994 else:
995 return self
996
997 @property
998 def unsqueeze(self):

Callers

nothing calls this directly

Calls 1

headOptionMethod · 0.95

Tested by

no test coverage detected