Skip to content

Instantly share code, notes, and snippets.

@thuwarakeshm
Created December 8, 2021 14:06
Show Gist options
  • Select an option

  • Save thuwarakeshm/9ff3dd8b5be9b221387f4bc2e6cd094e to your computer and use it in GitHub Desktop.

Select an option

Save thuwarakeshm/9ff3dd8b5be9b221387f4bc2e6cd094e to your computer and use it in GitHub Desktop.
import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.express as px
import pandas as pd
app = dash.Dash()
df = pd.read_csv(
"https://raw.githubusercontent.com/ThuwarakeshM/geting-started-with-plottly-dash/main/life_expectancy.csv"
)
fig = px.scatter(
df,
x="GDP",
y="Life expectancy",
size="Population",
color="continent",
hover_name="Country",
log_x=True,
size_max=60,
)
app.layout = html.Div([dcc.Graph(id="life-exp-vs-gdp", figure=fig)])
if __name__ == "__main__":
app.run_server(debug=True)
from typing import Text
import kivy
from kivy.uix.widget import Widget
kivy.require("2.0.0") # replace with your current kivy version !
from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.textinput import TextInput
from kivy.uix.gridlayout import GridLayout
class HomePage(GridLayout):
def __init__(self, **kwargs):
super(HomePage, self).__init__(**kwargs)
self.cols = 2
self.add_widget(Label(text="Hello, what's your name?"))
self.add_widget(TextInput(multiline=False))
class MyApp(App):
def build(self):
return HomePage()
if __name__ == "__main__":
MyApp().run()
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QLabel
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import pyqtSlot
def window():
app = QApplication(sys.argv)
widget = QWidget()
textLabel = QLabel(widget)
textLabel.setText("Hello World!")
textLabel.move(90,85)
widget.setGeometry(50,50,320,200)
widget.setWindowTitle("My first PyQt5 project")
widget.show()
sys.exit(app.exec_())
if __name__ == '__main__':
window()
sys.exit(app.exec_())
import streamlit as st
import pandas as pd
df = pd.read_csv(
"https://raw.githubusercontent.com/ThuwarakeshM/PracticalML-KMeans-Election/master/voters_demo_sample.csv"
)
st.title("Interactive K-Means Clustering")
st.write("Here is the dataset used in this analysis:")
st.write(df)
import tkinter as tk
root = tk.Tk()
txt = tk.Label(root, text="My First Tkinter App!")
txt.pack()
root.mainloop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment