"AttributeError: unexpected attribute 'plot_width' to figure, similar attributes are outer_width, width or min_width " with pandas_bokeh - pandas

I am trying to use pandas_bokeh to create a line graph with a pandas dataframe I call bucketed_df
import pandas_bokeh
pandas_bokeh.output_notebook()
bucketed_df.plot_bokeh(kind='line')
for some reason I get the error
AttributeError: unexpected attribute 'plot_width' to figure, similar attributes are outer_width, width or min_width
Im not sure what this is or how toi fix it. I am using python 3.9 and jupyter notebooks
I have a matplotlib linegraph in a cell above it. I am thinking there could be some issue with that.
Also if anyone knows any interactive graphs that are better I am open to switching to a different library.

I'm getting a similar error on a recent install of bokeh==3.0.1.
The error goes away if I install version 2.4.3 (last release) with pip install --upgrade bokeh==2.4.3
It seems there was a breaking change in 3.0.0 that hasn't been addressed yet. If you have time, post this issue at https://github.com/bokeh/bokeh/issues.

temp way:
File ".../lib/python3.10/site-packages/pandas_bokeh/plot.py", line 439, in plot
Add
figure_options['width'] = figure_options['plot_width']
figure_options['height'] = figure_options['plot_height']
del figure_options['plot_width']
del figure_options['plot_height']

can be done like
p=figure(min_width=500, height=500)
or simply,
p=figure(width=500, height=500)
this may help.

Related

I am getting error while executing my code as mediapipe.python.solutions has no attribute selfie_segmentation

self.mpSelfieSegmentation = mp.solutions.selfie_segmentation
AttributeError: module 'mediapipe.python.solutions' has no attribute 'selfie_segmentation'
Any one has solution for this?
I had the same issue, and I was initially on mediapipe==0.8.3.
Issue was resolved once I updated to mediapipe==0.8.9.1 using pip install mediapipe==0.8.9.1.

TensorFlow in PyCharm value error: Failed to find data adapter that can handle input

I am referring TensorFlow speciliazation from Coursera where a certain piece of code works absolutely fine in Google Colab, whereas when I try to run it locally on PyCharm, it gives following error:
Failed to find data adapter that can handle input
Any suggestions?
Can you tell me the code where the error occurred?
It should be available in logs under your PyCharm console.
Looking at your comments, it seems that the model is expecting an array while you provided a list.
I was facing the same issue. Turns out it was a in the form of a list. I had to convert the fields into a numpy array like:
training_padded = np.array(training_padded)
training_labels = np.array(training_labels)
testing_padded = np.array(testing_padded)
testing_labels = np.array(testing_labels)
thats it!
Try it out and let me know if it works.

Textacy - Vectorizer Weighting Error

I've recently found Textacy and as i go through the API reference guide I'm running into an error for the Vectorizer. If i add any options from the API reference I get a TypeError: unexpected keyword argument. I get this error for other options in addition to weighting.
I installed textacy using pip and I'm using Python3 on Ubuntu. Any help is appreciated. Thanks!
vectorizer = textacy.vsm.Vectorizer(weighting='tfidf')
TypeError: __init__() got an unexpected keyword argument 'weighting'
Ran into the same problem. The API documentation does not reflect the current Vectorizer keyword arguments. The Vectorizer now provides different keyword arguments to allow more control over how TF*IDF is applied.
vectorizer = textacy.Vectorizer(tf_type='linear', apply_idf=True, idf_type='smooth')
tf_type applies standard term frequency (TF), apply_idf=True applies the inverse document frequency (IDF). From the repo comments, idf_type='smooth' adds one to each document frequency in order to avoid zero divisions.
To see more information about the options check the comment at line 182 in the repository here: https://github.com/chartbeat-labs/textacy/blob/master/textacy/vsm/vectorizers.py

Why is the plotting-functions of package "ControlSystems" in Julia giving me a "UndefVarError: subplot not defined"?

I use Julia 0.4.3 and I have updated all packages using Pkg.update().
From the "ControlSystems" documentation, it is explicitly stated that plotting requires extra care in that the user is free to choose plotting back-end (I guess back-end means which plotting-package is used by "ControlSystems"). I have installed and like to use pyplot - hence I try the following code:
using ControlSystems
Plots.pyplot()
s = tf("s");
G = 1/(s+1);
stepplot(G);
Gives the error-message
ERROR: UndefVarError: subplot not defined
in stepplot at C:\folder\.julia\v0.4\ControlSystems\src\plotting.jl81
in stepplot at C:\folder\.julia\v0.4\ControlSystems\src\plotting.jl103
I have also tried the same code without the "Plots.pyplot()"-command.

Pandas in python 2.7 for ArcGIS

I have found that pandas v13.0 for Python 2.7 win32 works for most codes I have written in which I want to use both arcpy and pandas. I put that pandas version into the C:\Python27\ArcGIS10.2\Lib\site-packages directory. I tried other versions, but got miscellaneous errors when trying to run them.
I wrote a new code today, however, that manages to not work. It gives the error:
Access violation at address 1E0ACF39 in module 'python27.dll'. Read of
address 9807D3AF.
with the following code:
cond = dfDSS['OBSERVATION NAME']=='A413011CC1'
dfDSS['GROUP'][cond]='HA273UTheads'
All the code before this to create dfDSS using pd.read_csv and inserting the column 'GROUP' with a value of 'other' everywhere is fine. Only when I try to reset the values using the conditional statement.
The code to this point was written in iPython Notebook using Anaconda, but I now want to do some arcpy stuff with it.
Any suggestions in getting the different versions of Python to work together are appreciated.