I have a list containing tupels, i.e.
df = [('apa', 'apc'), ('apa', 'bp'), ('br', 'bpt')]
with
df[0]
I would get
('apa', 'apc')
How could I get 'apa' only from that tuple?
I believe you are looking for this:
a, b = df[0]
which in case of your data would set value of a
to apa
and b
to apc
. If you want just to get apa
from your tuple, then refer as you'd with lists:
a = df[0][0]