Hey. I'm importing an array in a text file via array=numpy.loadtxt("testdata.txt")
.
Is there an easy way to count the number of rows and columns? Maybe something like x=numpy.countrow(array)
?
I've had a look around and couldn't find anything suitable.
Thanks, Alex
Chromana
0
Newbie Poster
Recommended Answers
Jump to PostUse numpy shape ...
import numpy as np # create a 3 by 5 array of integer zeroes z = np.zeros([3, 5], int) print( z ) """ [[0 0 0 0 0] [0 0 0 0 0] [0 0 0 0 0]] """ # check the shape …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.