FabricDataFrames dynamically expose semantic functions based on logic defined by each function. For example, the is_holiday function shows up in the autocomplete suggestions when you're working on a FabricDataFrame containing both a datetime column and a country column.
Each semantic function uses information about the data types, metadata (such as Power BI data categories), and the data in a FabricDataFrame or FabricSeries to determine its relevance to the particular data on which you're working.
Semantic functions are automatically discovered when annotated with the @semantic_function decorator. You can think of semantic functions as being similar to C# extension methods applied to the popular DataFrame concept.
```python
from sempy.fabric import FabricDataFrame
df = FabricDataFrame({
"lat": [40.7128, 47.8095, 47.8095, 47.8095],
"long": [-74.0060, 13.0550, 13.0550, 13.0550],
"date": ["2023-01-06", "2023-01-06", "2023-01-07", "2023-01-10"]
},
column_metadata={"lat": {"data_category": "Latitude"}, "long": {"data_category": "Longitude"}},
)
df["date"] = pd.to_datetime(df["date"])
df_weather = df.add_weather_meteostat("lat", "long", "date")
```
Raw data
{
"_id": null,
"home_page": "https://github.com/microsoft/semantic-link-functions",
"name": "semantic-link-functions-meteostat",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": null,
"author": "Microsoft",
"author_email": "semanticdatascience@service.microsoft.com",
"download_url": null,
"platform": "Microsoft Fabric",
"description": "FabricDataFrames dynamically expose semantic functions based on logic defined by each function. For example, the is_holiday function shows up in the autocomplete suggestions when you're working on a FabricDataFrame containing both a datetime column and a country column.\n\nEach semantic function uses information about the data types, metadata (such as Power BI data categories), and the data in a FabricDataFrame or FabricSeries to determine its relevance to the particular data on which you're working.\n\nSemantic functions are automatically discovered when annotated with the @semantic_function decorator. You can think of semantic functions as being similar to C# extension methods applied to the popular DataFrame concept.\n\n```python\nfrom sempy.fabric import FabricDataFrame\n\ndf = FabricDataFrame({\n \"lat\": [40.7128, 47.8095, 47.8095, 47.8095],\n \"long\": [-74.0060, 13.0550, 13.0550, 13.0550],\n \"date\": [\"2023-01-06\", \"2023-01-06\", \"2023-01-07\", \"2023-01-10\"]\n },\n column_metadata={\"lat\": {\"data_category\": \"Latitude\"}, \"long\": {\"data_category\": \"Longitude\"}},\n)\n\ndf[\"date\"] = pd.to_datetime(df[\"date\"])\n\ndf_weather = df.add_weather_meteostat(\"lat\", \"long\", \"date\")\n\n```\n\n\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Semantic link functions for meteostat package. Enables enrichment of FabricDataFrame with historical weather data.",
"version": "0.7.3",
"project_urls": {
"Homepage": "https://github.com/microsoft/semantic-link-functions"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "cb1ea387ad23a2d3670d7e65bd7851428274f0deebb975dcac6ae78215c03b4e",
"md5": "47e00488a0c2bbe64cf04bf8e7634e00",
"sha256": "fed2b3246f675383a1e263023aed906e851bd648ff3d5dd41644204db864fa62"
},
"downloads": -1,
"filename": "semantic_link_functions_meteostat-0.7.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "47e00488a0c2bbe64cf04bf8e7634e00",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 4490,
"upload_time": "2024-05-14T10:12:03",
"upload_time_iso_8601": "2024-05-14T10:12:03.993201Z",
"url": "https://files.pythonhosted.org/packages/cb/1e/a387ad23a2d3670d7e65bd7851428274f0deebb975dcac6ae78215c03b4e/semantic_link_functions_meteostat-0.7.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-14 10:12:03",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "microsoft",
"github_project": "semantic-link-functions",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "semantic-link-functions-meteostat"
}