Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
153 views
in Technique[技术] by (71.8m points)

python - Wrap a 2-D array as a tuple

I have a, for example, numpy array X with a shape of [500, 20]. I want to convert it to a tuple Y that has 1 element, which is that numpy array X. If I call len(Y), it should return 1. If I call type(Y), it should return tuple. If I call Y[0].shape, it should return [500, 20]. If I call type(Y[0]), it should return np.array. How can I do that? Thanks!

question from:https://stackoverflow.com/questions/66048291/wrap-a-2-d-array-as-a-tuple

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...