Issue
I would a list like this example: [1970s, 1980s, 1990, 2000s, 2010s]
.
list = [year for year in np.arange(1970, 2020, 10)]
creates a list without the "s"
letter.
Is there a way to add a string during list generation? I tried "+ "s""
, .append and similar but nothing worked.
I just need a list to be used as bin_labels. The comments solved the issues. Thanks.
Solution
You can use the format() function:
base = "{}s"
[base.format(year) for year in np.arange(1970, 2020, 10)]
Answered By - AER
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.