I would like to refer to paragraph 3 in my question, asking for the role of the word: Value
.
Being more explicit, I'm talking about this code line:
print(df[['Gold']][df.Value == df.Value.max()])
Referring the answer I've got,
I'm talking also about the role of the word: Value
also in this snippet:
for value in df['Gold']:
if value>CurrentMax:
CurrentMax = value
And referring this question, in these code lines:
The following four (separated) code lines, in which it is written: 'Value'
(or ['Value']
), with CAPITAL V:
data.groupby(['Country','Place'])['Value'].max()
df.loc[df['Value'].idxmax()]
df[df['Value']==df['Value'].max()]
print '%s, %s, %s' % (s['Country'], s['Place'], s['Value'])
In this code line, in which it is written: 'value'
(or ['value']
), with small v:
df.groupby(['country','place'], as_index=False)['value'].max()
And in this code line, in which it is written between dots and with small letters, without apostrophes:
df.groupby("country").apply(lambda df:df.irow(df.value.argmax()))
An important note:
I'm actually asking SEVERAL QUESTIONS here:
- Why are there differences in the way the word
Value
is written? - Is that word a function? A keyword? An attribute? Something else?
- What is the word's role in each piece of code written above?
Just to distinguish, I was looking also at the values()
function here,
and also searched the word Value
in the Pandas DataFrame Documentation,
to check whether it was an attribute, a method or (maybe) something else.
I didn't find anything in this last document.
Thanks!