You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromastropyimporttabledefsomefunc(df, ...):
"""`df` can be any dataframe supporting the protocol."""astropy_df=table.from_dataframe(df) # converts without copying# From now on, use Table internally
I was poking around the Table code (due to #15905 (comment)) and I was wondering if there is an appetite to get this moving. This should (in theory) enable to use the plotting code already written of libraries like pandas with Table.
Thanks for pointing this out @ManonMarchand. Do you have any interest in contributing the necessary methods for astropy.table.Table to support the protocol?
Not sure I have much insight, but maybe helps to keep in mind that a QTable is really just a collection of array-likes that have the same length. If all those array likes support chunking, then the table holding them should too, but for a generic table that has some Quantity, Time, or SkyCoord that would not be the case. My guess is that we'd need Quantity 2.0 to make real progress here -- though really the first thing may be to set out some specific use cases...
Bumping this. I was just looking at using Altair for some plotting, but it requires pandas dataframes or a table that implements the dataframe interchange protocol. Astropy could become compatible with Altair for nice interactive plots!
I took a quick look and this seems like a very good thing and something we should pursue. To a large extent the base Table API is close to numpy arrays (column) and structured array (table). Is there a relevant example for making those objects compliant with the DataFrame protocol? I.e. has someone done some or most of our work already?
Activity
pllim commentedon Jul 4, 2022
It looks like they still trying to finalize things?
nstarman commentedon Jul 4, 2022
Yeah, this is more of a long term thing to keep on our radar.
mhvk commentedon Jul 5, 2022
What are concrete examples of this? Would it be between a pandas column and a table one?
nstarman commentedon Jul 5, 2022
Yeah, with this protocol, we could have
MridulS commentedon Jan 19, 2024
I was poking around the
Tablecode (due to #15905 (comment)) and I was wondering if there is an appetite to get this moving. This should (in theory) enable to use the plotting code already written of libraries like pandas withTable.I think it is still moving slowly https://github.com/data-apis/dataframe-api but maybe we can poke around?
ManonMarchand commentedon Jul 31, 2024
There are example implementations in this repo: https://github.com/data-apis/dataframe-api-compat
nstarman commentedon Jul 31, 2024
Thanks for pointing this out @ManonMarchand. Do you have any interest in contributing the necessary methods for
astropy.table.Tableto support the protocol?ManonMarchand commentedon Aug 2, 2024
I don't understand all the points that have to be implemented in
buffer.pyandfrom_dataframe.py. Do astropy Tables have chunks?nstarman commentedon Aug 12, 2024
@mhvk, perhaps you could lend some insight?
But @ManonMarchand, I don't believe Tables support chunking.
mhvk commentedon Aug 12, 2024
Not sure I have much insight, but maybe helps to keep in mind that a
QTableis really just a collection of array-likes that have the same length. If all those array likes support chunking, then the table holding them should too, but for a generic table that has someQuantity,Time, orSkyCoordthat would not be the case. My guess is that we'd need Quantity 2.0 to make real progress here -- though really the first thing may be to set out some specific use cases...nstarman commentedon Nov 25, 2024
Bumping this. I was just looking at using Altair for some plotting, but it requires pandas dataframes or a table that implements the dataframe interchange protocol. Astropy could become compatible with Altair for nice interactive plots!
taldcroft commentedon Dec 7, 2024
I took a quick look and this seems like a very good thing and something we should pursue. To a large extent the base
TableAPI is close to numpy arrays (column) and structured array (table). Is there a relevant example for making those objects compliant with the DataFrame protocol? I.e. has someone done some or most of our work already?pllim commentedon May 8, 2026
Perhaps fixed in #18435