This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import datetime | |
import plotly.graph_objects as go | |
import numpy as np |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
snow_data = pd.read_csv("https://raw.githubusercontent.com/Dataviz-Stockholm/challenges/main/date_temperature_snow.csv") | |
print(snow_data.dtypes) | |
snow_data.head() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def build_yaxis(snow_max): | |
y_axis = [] | |
for i, value in enumerate(snow_max): | |
y_axis+=[value,value] | |
return y_axis | |
y_axis = build_yaxis(snow_max) | |
y_axis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fig = go.Figure() | |
fig.add_trace(go.Scatter(x=x_axis,y=y_axis,mode="lines",line=dict(color="white",width=4))) | |
fig.update_layout(template="plotly_dark", | |
xaxis=dict(showgrid=False,visible=False), | |
yaxis=dict(showgrid=False,visible=False), | |
title="<b>Max snow depth in Stockholm during the years 1938-2020</b>") | |
fig.show() |
OlderNewer