Given
import pandas as pd
df = pd.DataFrame({'lowercase':['a','b','c','d']},
index=[0,1,3,4])
# print(df)
print(df['lowercase'].iat[0])
I can get 'a', but I want to get the first index (which is 0) and 'a' return as two values, how should I do?
df.index[0]df.index[0]? what do you mean byand 'a' return as two values,?a=df['lowercase'].index[0] b=df['lowercase'].iat[0]Can this be simplify in one line?a, b = df['lowercase'].index[0], df['lowercase'].iat[0]? It's one line :)a,b = [*df['lowercase'].head(1).items()][0]?