I'm looking up a certain row in my Pandas DataFrame by using the index - the row information is stored in variable p
. As you can see p
gives me a normal Pandas DataFrame. Now I want to save just the integer in in_reply_to_status_id
as variable y
but, in my code below, it gives me an object. Does anyone know if and how it would be possible to just store the integer (1243885949697888263
in this case) as y?
CodePudding user response:
y is a series, you can try as follow to pick second (1243885949697888263) value
print(y.array[0])
CodePudding user response:
Did you try this?
y = df.at[i, 'in_reply_to_status_id']
That way you don't have to create p
.
If you want to do it with p
:
y = p.iloc[0].at['in_reply_to_status_id']
Or:
y = p.iat[0,1]
Or:
y = p.at[i, 'in_reply_to_status_id']