[Tutor] adding numpy to pandas

Mats Wichmann mats at wichmann.us
Thu Jun 21 11:30:37 EDT 2018


On 06/20/2018 02:04 PM, Glenn Schultz wrote:
> All,
> 
> I have a pandas dataframe and a predict result (numpy array) of a
> classifier [[0,1],[1,0]].  What I would like to do is as the positive to
> the pandas dataframe.  I use predict[:,1] to slice the postive from
> numpy which gives me a row of the result.  but I cannot concat to the
> pandas df['result'] = predict[:,1] does not work and I have tried
> various ways to do this with no result.  I am missing something here.

You should take a look here:

https://pandas.pydata.org/community.html

History has indicated that the Python tutor group isn't overloaded with
Pandas experts. You may still get an answer here, but that page suggests
the preferred places from the community to interact with to get good
answers.  There's also a Google Groups which doesn't seem to be
mentioned on the page:

https://groups.google.com/forum/#!forum/pydata



More information about the Tutor mailing list