0

I want to add [13178.0, 13178.0, 14130.0, 15082.0, 15082.0, 15082.0, 16034.0, 16034.0, 16986.0, 16986.0, 16986.0] in a list, so I use

pred_set.append([13178.0, 13178.0, 14130.0, 15082.0, 15082.0, 15082.0, 16034.0, 16034.0, 16986.0, 16986.0, 16986.0])

however, the result shows they are in same row: enter image description here I want to them in different row, like the data below them, how to do it?

0

1 Answer 1

2

Use extend:

l = [13005]
l.extend([13178.0, 13178.0, 14130.0, 15082.0, 15082.0, 15082.0, 16034.0, 16034.0, 16986.0, 16986.0, 16986.0])
l

Output:

[13005,
 13178.0,
 13178.0,
 14130.0,
 15082.0,
 15082.0,
 15082.0,
 16034.0,
 16034.0,
 16986.0,
 16986.0,
 16986.0]
Sign up to request clarification or add additional context in comments.

1 Comment

This is a big duplicate, please don't answer to such, flag as duplicate to avoid spreding the answers, you can delete this post as the duplicate have been found

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.