Functions Defined The core of extensible programming is defining functions. Python allows mandatory and optional arguments, keyword arguments, and even arbitrary argument lists.

Get first element of Series without knowing the index

Question or problem about Python programming: Is that any way that I can get first element of Seires without have information on index. For example,We have a Series import pandas as pd key=’MCS096′ SUBJECTS=pd.DataFrame({‘ID’:Series([146],index=[145]),\ ‘study’:Series([‘MCS’],index=[145]),\ ‘center’:Series([‘Mag’],index=[145]),\ ‘initials’:Series([‘MCS096’],index=[145]) }) prints out SUBJECTS: print (SUBJECTS[SUBJECTS.initials==key][‘ID’]) 145 146 Name: ID, dtype: int64 How can I get the value […]

Continue Reading