0

all,
My input:

logs = pd.DataFrame({'foo':['A','B','C','D'],'bar':[[12,13,14],[10,9,11],[1,2,3],[4,5,6]] })

I trying extract specific element from column where data is list of values. For example I need extract from column bar where first row A, first value 12 in list of [12,13,14]. And in continue run some loop per all list to extract and assign each element of list in new values and do it over all dataframe. So my code:

logs.iloc[0:1,1].values[0]

And I expect get 12, but it doesn't happen

1
  • 1
    Just take the first item using [0], logs.iloc[0:1,1].values[0][0] Commented Nov 14, 2021 at 11:46

1 Answer 1

3

enter image description here

you can use it and do something like it

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.