How to read CSV in NumPy

You can read CSV in NumPy with the following code. If you want to learn Python, I highly recommend reading This Book.

How to read csv in NumPy
How to read CSV in NumPy
from numpy import genfromtxt
data = genfromtxt('file.csv', delimiter=',')

# Display Data
print(data)

# Display data type
print(type(data))

# Display dimension of Data
print(data.ndim)
[[55.  5.]
 [60. 10.]
 [70. 15.]
 [90. 20.]
 [85.  7.]
 [40.  9.]]
<class 'numpy.ndarray'>
2

People are also reading:

Best Python Books

What is Computer Vision? Examples, Applications, Techniques

Books for Machine Learning (ML)

Free Learning Resources

Leave a Comment

Your email address will not be published.