Issue
I would like to be able to pull out an arbitrary row, such as the 4th row, and get an array so that I can send it through another function.
What would be the easiest way to do this?
Solution
# Dummy DataFrame
df = pd.DataFrame({'col1': [1,2,3], 'col2': [4,5,6]})
# Extract second row (index: 1)
df.iloc[1].values
Answered By - spadarian
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.