Getting the first column of a Pandas DataFrame as a Series results in a Pandas Series object representing the first column.
df = pd.DataFrame({"Letters": ["a", "b", "c"], "Numbers": [1, 2, 3]})
first_column = df.iloc[:, 0]
get first column of df
print(first_column)
Reference Link
(Python help)[https://www.adamsmith.haus/python/answers/how-to-get-the-first-column-of-a-pandas-dataframe-as-a-series-in-python]
标签:Python,DataFrame,column,Learning,df,Pandas,first From: https://www.cnblogs.com/Miguel-Du/p/16740249.html