Open WestXu opened 4 years ago
Thank you for the suggestion @WestXu
I'll have a look at what can be done and how it can fit into the current syntax. Don't hesitate to elaborate on this feature request if you have a specific idea on how it should work (esp. regarding multi-index).
I'm not professional at exactly how type annotation works in python, buy maybe this syntax is possible:
from dataenforce import Dataset, DataIndex
# index
Dataset[DataIndex["id": int], "name": object, "latitude": float, "longitude": float]
# multiindex
Dataset[DataIndex["date": "timestamp", "id": int], "name": object, "latitude": float, "longitude": float]
Also consider this:
from dataenforce import Dataset, DataIndex, DataColumns
Dataset[
"index": DataIndex["date": "timestamp", "id": int],
"columns": DataColumns["name": object, "latitude": float, "longitude": float]
]
Support for pandas Series is appreciated!
Also consider this:
from dataenforce import Dataset, DataIndex, DataColumns Dataset[ "index": DataIndex["date": "timestamp", "id": int], "columns": DataColumns["name": object, "latitude": float, "longitude": float] ]
This is a great solution
--which would be rather useful.
Cool project. Thanks.