How to Set X and Y in Pandas

Use y as the starting point for X — good for machine learning

Frank Neugebauer
CodeX
Published in
2 min readJan 30, 2022

--

Photo by Tolga Ulkan on Unsplash

What’s the Problem?

When dealing with a dataset with many features, it can be difficult to separately define the features (X) and the target(s) (y). Defining the target(s) is usually straightforward because there is usually one variable in the target (or there are very few)…

--

--

Frank Neugebauer
CodeX
Writer for

I manage Frankly Artificial Intelligence, LLC. I also work at Google (all my views are strictly my own). I enjoy teaching, cycling, running, music, and art.