Posts

Showing posts with the label plotly

AttributeError: module 'dash.dash' has no attribute 'dependencies'

AttributeError: module 'dash.dash' has no attribute 'dependencies' Below is my error, Traceback (most recent call last): File "app.py", line 54, in dash.dependencies.Output('react-graph','figure'), AttributeError: module 'dash.dash' has no attribute 'dependencies' Below are my imports, from dash import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output import plotly.graph_objs as go import psycopg2 import os import flask Below is my callback function @app.callback( dash.dependencies.Output('react-graph','figure'), [dash.dependencies.Input('reg_col','value')] ) I do not have any file named dash.py in my current directory. I have also tried to change to the import dash from dash to just import dash. The former gives me the below error. Dash was not successfully imported. Make sure you don't have a file named 'dash...

Plotly Time series forecasting in R - modify default x axis and y axis range

Image
Plotly Time series forecasting in R - modify default x axis and y axis range I have a query on Time series forecasting with plotly. I have built a forecasting chart however few things needs to be changed but its not working for me. Please find the attachment for details and kindly let me know the correction or suggestion for R code. Query: currently X Axis is showing 2,016.5, 2017 , 2017.5 , etc however I want it to show yearmonth like 2016.04,2014,05,etc. Please be informed yearmonth is a field in data, please refer attached data currently Y Axis is showing lables with the difference of 50 K , however I want it to show as 5 K, 10K,15K, etc. Below is R code used : library(forecast) library(plotly) ord <- order(ds$`Calendar Year-DISPLAY_KEY`,ds$`Calendar Month-DISPLAY_KEY`) sds <- ds[ord,] firstRec <- sds[1,] mn <- as.numeric(firstRec$'Calendar Month-DISPLAY_KEY') yr <- as.numeric(as.character(firstRec$'Calendar Year-DISPLAY_KEY')) tm <- ts(data = ...

Python/Dash by Plotly: Group cases by date

Python/Dash by Plotly: Group cases by date I got to plot barchart only for total cases of occurences and not group cases by date of occurences with this code: trace1=go.Bar( x=pd.to_datetime(dfb['date']), y=dfb.set_index('date').resample('M')["enrolled"].sum(), ) How to do groupby date? Dataset as below date enrolled 6/29/2018 1 6/29/2018 1 6/29/2018 6/29/2018 1 6/20/2018 1 6/22/2018 1 6/19/2018 1 6/27/2018 1 6/28/2018 6/27/2018 1 6/19/2018 1 6/20/2018 1 6/27/2018 1 6/27/2018 6/26/2018 1 6/27/2018 6/27/2018 1 Thanks 3 Answers 3 I used the following content in my data.csv : data.csv date enrolled 6/29/2018 1 6/29/2018 1 6/29/2018 0 6/29/2018 1 6/20/2018 1 6/22/2018 1 6/19/2018 1 6/27/2018 1 6/28/2018 0 6/27/2018 1 6/19/2018 1 6/20/2018 1 6/27/2018 1 6/27/2018 0 6/26/2018 1 6/27/2018 0...