Transforming your single-column DataFrame to a Series using the squeeze() function can help avoid this error.