Table(list_of_dicts) does not work as expected for quantities
See original GitHub issueDescription
Giving Table
a list of dicts with quantities results in dtype object with single quantities in each row / column.
Expected behavior
Detect the quantities and create a column that has dtype float and a unit attached.
Actual behavior
See description
Steps to Reproduce
In [1]: from astropy.table import Table
In [2]: import astropy.units as u
In [3]: data = [{'x': 5 * u.m, 'y': 0 * u.m}, {'x': 10 * u.m, 'y': 3 * u.m}]
In [4]: Table(data)
Out[4]:
<Table length=2>
x y
object object
------ ------
5.0 m 0.0 m
10.0 m 3.0 m
System Details
Linux-5.10.15-1-MANJARO-x86_64-with-glibc2.33
Python 3.9.1 (default, Feb 6 2021, 06:49:13)
[GCC 10.2.0]
Numpy 1.20.0
astropy 4.2
Scipy 1.6.0
Matplotlib 3.3.4
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
List of unique dictionaries - python - Stack Overflow
The problem, of course, is that a set() can only contain hashable entries, and a dict is not hashable. If I had this...
Read more >Performance Issues Working with Anvil Data Tables and Row ...
After investigating, it seems that a lot of my issues arose from constructing lists of dicts/AnvilRows from a table.search() .
Read more >django-tables2 - Read the Docs
In an example we will demonstrate using list of dicts. ... change that you do not want to use in multiple tables or...
Read more >Tables — RPA Framework documentation
Tables is a library for manipulating tabular data inside Robot Framework. It can import data from various sources and apply different operations to...
Read more >ansible - Search a list of Dicts using a list of items and find if ...
The condition is true as the 3rd item is not found as expected, but my variable is being set with all items from...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s probably for another issue, but we found issues with accessing metadata with QTable.
See #11329.