Comments (2)
Thanks for the heads up, I will update the notebook example when I get time
from hass-data-detective.
I guess it is more a matter of updating the detective package by enforcing the unit='s'
in functions.format_dataframe()
than the notebook, unless you want to pass it as a new argument when called from the notebook example?
For now, I am just redefining format_dataframe() at the beginning of my notebook so that pd.to_datetime()
includes the unit='s'
argument instead of relying on the one imported from functions:
def format_dataframe(df: pd.DataFrame) -> pd.DataFrame:
"""Convert states to numeric where possible and format the last_changed."""
df["state"] = pd.to_numeric(df["state"], errors="coerce")
df["last_updated_ts"] = pd.to_datetime(
df["last_updated_ts"].values, errors="ignore", utc=True, unit='s'
).tz_localize(None)
df = df.dropna()
return df
from hass-data-detective.
Related Issues (20)
- Query event table
- checkout traces
- Problem with View States section in Getting Started : 'HassDatabase' object has no attribute 'fetch_all_data' HOT 6
- Add streamlit UI to allow viewing historical data and make predictions HOT 3
- Add support for !include_dir_* HOT 10
- Tryout plotly time series
- Checkout jupyterlite HOT 3
- Column "domain" does not exist HOT 12
- OperationalError: no such column: domain HOT 1
- Add query on statistics tables
- CI action failing to to flake8
- TypeError: the JSON object must be str, bytes or bytearray, not NoneType HOT 5
- Raspbian failed HOT 1
- Fix sql api HOT 3
- Add test.db for functional tests
- AttributeError: 'Engine' object has no attribute 'execute' when excuting detective.HassDatabase(db_url) HOT 3
- Updates to schema
- Error using Windows: expected str, bytes or os.PathLike object, not HassDatabase HOT 1
- AttributeError: 'str' object has no attribute '_execute_on_connection' HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hass-data-detective.