jekwatt / idiomatic_pandas

Tips and tricks for the most common data handling task with pandas.
0 stars 0 forks source link

Series vs. DataFrame #11

Open jekwatt opened 4 years ago

jekwatt commented 4 years ago

Series df["col_1"]

DataFrame df[["col_1"]]

Covert Series to DataFrame: s1.to_dataframe()

Convert DataFrame to Series: When generating the original data set, there is a call to .squeeze() which turns a DataFrame with a single column into a Series.