def _take_last(a, skipna=True):
 if (skipna is False):
  return a.iloc[(-1)]
 else:
  group_dummy = np.ones(len(a.index))
  last_row = a.groupby(group_dummy).last()
  if isinstance(a, pd.DataFrame):
   return pd.Series(last_row.values[0], index=a.columns)
  else:
   return last_row.values[0]

def _take_last ( a , skipna = True ) : if ( skipna is False ) : return a . iloc [ ( - 1 ) ] else : group_dummy = np . ones ( len ( a . index ) ) last_row = a . groupby ( group_dummy ) . last ( ) if isinstance ( a , pd . DataFrame ) : return pd . Series ( last_row . values [ 0 ] , index = a . columns ) else : return last_row . values [ 0 ]
take last row of dataframe / last value of series considering nan .