Sample code for multiple-level treemap generation.This example also includes some methods on pandas data processing, such as: How to create a pandas dataframe? How to append several dataframe to construct a bigger dataframe? How to build a hierarchical dataframe? import pandas as pd import numpy as np import plotly.express as px import plotly.graph_objects as go ..
Category : Plotly
The following example shows you how to draw multiple subplots with different widths and heights. It also tells you the answers to some other questions. How to do technical analysis of a stock? How to draw double y-axis plot? How to set height of a subplot? import numpy as np import talib import emoji import ..
Following is my python code to plot stock chart on a background image from local file. The code is not optimal, I will improve it later. Hope it be useful. The example is plot ABX.TO.csv (download from yahoo finance) data on a logo collection image (my file:/media/Data1/XIU/AACodes/NASDAQ_stocks.png). Code # plot stock data with a background-image ..
This example is used for fitting world covid-19 cases number import numpy as np import pandas as pd from datetime import datetime from lmfit import Minimizer, Parameters, report_fit import chart_studio.plotly as py import cufflinks as cf def Cauchy_cumulative_hazard_fit(x,loc,scale,decaybase): decayterm=np.power(decaybase,(x-loc)) decayterm[np.whe..
import pandas as pd import numpy as np # model from lmfit import Minimizer, Parameters, report_fit #plot import chart_studio.plotly as py import ipywidgets as widgets from ipywidgets import interact, interact_manual import cufflinks as cf theCountry=’Canada’ threshhold=10 theData=confirmed_series_21[confirmed_series_21[theCountry]>threshhold] data=theData[theCountry] start_date= data.index[0] end_date= data.index[-1] dateData=pd.date_range(start=start_date,end=end_date) forecastDays=60 dateForecast= pd.date_range(start=end_date,periods=forecastDays+1)[1:] dateObsForecast=dateData.append(dateForecast) #dateObsForecast # define objective function: returns the array ..