Skip to content

Add DataFrame.conj/conjugate #2381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
changhiskhan opened this issue Nov 29, 2012 · 5 comments
Closed

Add DataFrame.conj/conjugate #2381

changhiskhan opened this issue Nov 29, 2012 · 5 comments
Milestone

Comments

@changhiskhan
Copy link
Contributor

From mailing list

I noticed that Series has methods .conj() and .conjugate() but dataframe does not. Doing a search on complex numbers in pandas, I found this issue.

#1083

Is there any hope of getting .conj() onto the dataframe? Or should I convert to an np-array, then convert back to a df?

@hughesadam87
Copy link

This may not be the robust solution that would be ideal, but isn't it easy enough to convert to an np array, conjugate, and then recast into a DataFrame?

df=DataFrame()
df_conj = DataFrame(np.asarray(df).conj(), index=df.index, columns=df.columns)

@wesm
Copy link
Member

wesm commented Nov 29, 2012

np.conj(df) should work too, no?

@hughesadam87
Copy link

Ah, you're right. I didn't realize np.conj() was a function, thought that .conj() only existed as an instance method of a numpy array. I guess this problem is solved, thanks.

@paulproteus
Copy link

@wesm or @changhiskhan -- which of the following is the best answer here:

  • Close the ticket and mark it as resolved, or
  • Have a new contributor write a simple .conj() or .conjugate() method for DataFrame

?

If the latter, that'd be great; the code would be super easy. If the former, then one of the maintainers should close it.

Thanks!

@wesm
Copy link
Member

wesm commented Dec 16, 2012

Closing-- I think ``np.conj(df)` is the preferred API for now

@wesm wesm closed this as completed Dec 16, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants