Skip to content

Instantly share code, notes, and snippets.

View AnupJoseph's full-sized avatar
💭
Coding

AnupJoseph

💭
Coding
View GitHub Profile
import pandas as pd
import datetime
import plotly.graph_objects as go
import numpy as np
snow_data = pd.read_csv("https://raw.githubusercontent.com/Dataviz-Stockholm/challenges/main/date_temperature_snow.csv")
print(snow_data.dtypes)
snow_data.head()
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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()
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.