Issue
I am reviewing the following discussion:
Plot a 2D graph from a csv file using matplotlib in Python in ubuntu
We use the code
np.loadtxt('text.csv', delimiter=',')
I believe this assumes that the data we want starts at the 1st row of .csv file.
My question is that if the data we want starts at, for example 5th row of .csv file.
For example
1. #Title 1
2. #Explanation 2
3. #Explanation 3
4. #Explanation 4
5. 1 3.7
6. 1.1 4.2
7. 1.2 5.3
.
.
.
The data we want to plot start at the 5th row. Then how to modify the code above to correctly plot the contents in that .csv file?
Thanks!
Solution
You have to specify the skiprows
parameter (documentation):
np.loadtxt('text.csv', delimiter=',', skiprows=N)
Answered By - Zephyr
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.