How-to articles, tricks, and solutions about NUMPY
Convert pandas dataframe to NumPy array
In pandas, you can convert a DataFrame to a NumPy array by using the values attribute.
Dump a NumPy array into a csv file
Here's an example code snippet that demonstrates how to dump a NumPy array into a CSV file:
How can the Euclidean distance be calculated with NumPy?
Here is a code snippet that shows how to calculate the Euclidean distance using NumPy:
How do I access the ith column of a NumPy multidimensional array?
You can access the ith column of a NumPy multidimensional array by using the following syntax:
How do I read CSV data into a record array in NumPy?
You can use the numpy.genfromtxt() function to read CSV data into a NumPy record array.