I want to save some data from Twitter and I would to use a 2-dimensional array in order to save all hashtags in the first row and all external urls in the second one, with dynamic cols.
I've implemented this:
hashtag_extLink = 2 * [[]]
...
...
if field == "hashtag":
hashtag_extLink[0].append(x)
elif field == "ext_link":
hashtag_extlink[1].append(y)
else:
pass
but, when I will print the hashtag_extLink using this statement:
for row in range(len(hashtag_extLink)):
print("Row %d" % row)
for col in range(len(hashtag_extLink[row])):
print(hashtag_extLink[row][col], end='')
print("")
I get:
Row 0
xy
Row 1
xy
that is the append() function add value to both rows.
How can I fix? Have I to use Numpy?
Thank you in advance.