Skip to content

Instantly share code, notes, and snippets.

View bilative's full-sized avatar
🙂

Bilal Latif Ozdemir bilative

🙂
View GitHub Profile
import plotly.express as px
data = px.data.gapminder()
data_canada = data[data.country == 'Canada']
fig = px.bar(data_canada, x='year', y='pop',
hover_data=['lifeExp', 'gdpPercap'], color='lifeExp',
labels={'pop':'population of Canada'}, height=400)
fig.show()
import numpy as np
import pandas as pd
import dash
import dash_table
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
from plotly import graph_objects as go
import plotly.express as px
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import pandas as pd
import plotly.express as px
df=pd.read_csv("train.csv")
pie_options=[{'label': i.title(), 'value': i} for i in ["Heating","HeatingQC","CentralAir","Electrical"]]
@app.callback([Output("graf5","figure"), #Bu şekilde tek fonksiyon/callbackten birden fazla çıktı almak da mümkün
Output("graf4","figure")],
Input("line-var1","value")) #
def graf4_5_multi(var):
every_5=df.groupby((df["YearBuilt"]//5)*5).mean() #beşer yıllık ortalamaları alma
every_5["ind"]=every_5.index
df_melt = every_5.melt(id_vars='ind', value_vars=var) #sağlıklı bir px.line plot için format değişikliği
multi_line=px.line(df_melt, x='ind' , y='value' , color='variable')
multi_line.update_layout(height=410, title='Seçilen Değişkenlerin \n 5 Yıllık Ortalama Değerleri', paper_bgcolor=renk3)
from plotly.subplots import make_subplots
import plotly.graph_objects as go
fig = make_subplots(rows=1, cols=2,subplot_titles=( "Scatter Plot", "Line Plot"))
fig.add_trace(
go.Scatter(x=kilyos['DATE_TIME'], y=kilyos['AVERAGE_TEMPERATURE'], mode="markers"),
row=1, col=1)
fig.add_trace(
go.Scatter(x=kilyos['DATE_TIME'], y=kilyos['AVERAGE_TEMPERATURE'], mode="lines"),
import plotly.express as px
fig = px.box(df, x="TRANSPORT_TYPE_DESC", y="NUMBER_OF_PASSENGER", color="TRANSFER_TYPE")
fig.show()
import plotly.express as px
fig =px.bar(ray, y='İlçe Adı', x='Yürüyen Merdiven Sayısı', color='İstasyon Adı', orientation='h', width=1300, height=500)
fig = fig.update_layout(showlegend=False)
fig.show()
from plotly.subplots import make_subplots
import plotly.graph_objects as go
fig = make_subplots(rows=1, cols=2,subplot_titles=( "Scatter Plot", "Line Plot"))
fig.add_trace(
go.Scatter(x=kilyos['DATE_TIME'], y=kilyos['AVERAGE_TEMPERATURE'], mode="markers"),
row=1, col=1)
fig.add_trace(
go.Scatter(x=kilyos['DATE_TIME'], y=kilyos['AVERAGE_TEMPERATURE'], mode="lines"),
import plotly.express as px
kilyos= df[df['OBSERVATORY_NAME']=='KILYOS']
scatter = px.scatter(kilyos, x='AVERAGE_TEMPERATURE', y='AVERAGE_FELT_TEMPERATURE',
color="AVERAGE_HUMIDITY", hover_name='DATE_TIME')
scatter = scatter.update_layout(
title="Kilyos Lokasyonu Sensor Datalari",
xaxis_title="Ortalama Sicaklik",
yaxis_title="Ortalama Hissedile Sicaklik",
coloraxis_colorbar=dict(
title="Ortalama Nem"))
import seaborn as sns
sns.heatmap(ray.corr(), annot= True)