Venue 21 - weather comparison#

Venue 21 is a classic church, usually heated only for Sunday services. They were wondering how their internal temperature relates to the weather. This weather station is in an undisclosed location in a city close to the venue.

Hide code cell source
# import ipywidgets as widgets
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go   

df1 = pd.read_csv("./venue-21/venue_21_with_device_3083988F23C0.csv")
df2 = pd.read_csv("./venue-21/venue-21-weather.csv")
df1 = df1[(df1.temperature >-10)] # eliminate rogue data

trace1 = go.Scatter(customdata=df1, 
                    y=df1['temperature'], 
                    x = df1['timestamp'], 
                    mode='lines', 
                    hoverinfo='all', 
                    name='internal temperature (degC)',
                    )

trace2 = go.Scatter(customdata=df2, 
                    y=df2['temperature'], 
                    x = df2['timestamp'], 
                    mode='lines', 
                    hoverinfo='all', 
                    name='external temperature (degC)',
                    )

g = go.FigureWidget(data=[trace1,trace2],
                    layout = go.Layout(
                        yaxis=dict(range=[-13,25])
                    ))

fig = go.Figure(g)
fig.update_layout(showlegend=True, 
              autosize = True, 
              width=1000, 
              height=500,
)

fig.update_layout(
    hovermode='x unified',
   # range=[range_min, range_max],
    hoverlabel=dict(
        bgcolor="white",
        # font_size=16,
        font_family="Rockwell"
    )
)

#Add range slider
fig.update_layout(
    xaxis=dict(
        rangeselector=dict(
            buttons=list([
                dict(
                     label="All",
                     step="all"
                     ),
                                dict(count=1,
                     label="Hour",
                     step="hour",
                     stepmode="todate"),
                dict(count=1,
                     label="Day",
                     step="day",
                     stepmode="backward"),
                dict(count=7,
                     label="Week",
                     step="day",
                     stepmode="backward"),
                dict(count=1,
                     label="Year",
                     step="year",
                     stepmode="backward")
            ])
        ),
        rangeslider=dict(
            visible=True,
        ),
        type="date"
    )
)


#fig.add_hline(y=16, annotation_text='16C - usual minimum for children', annotation_font_color="blue", line_color='red', layer='above', line_dash='dash')
# fig.update_yaxes(range = [-5, dfCollatedDataSet['temperature'].max()+5])
fig.show()
/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/jupyter_client/session.py:721: UserWarning: Message serialization failed with:
Out of range float values are not JSON compliant
Supporting this message is deprecated in jupyter-client 7, please make sure your message is JSON-compliant
  content = self.pack(content)