Skip to content

Plotly: What color cycle does plotly express follow?

I would think that the default color cycle would be (some variants of) [‘blue’, ‘red’, ‘green’, ‘purple’, ‘orange’] like in the plot below: Plot 1: Code 1: At least that seems to be the order of the cycle since omitting Oceania from the continents wi…

Removing SEP token in Bert for text classification

Given a sentiment classification dataset, I want to fine-tune Bert. As you know that BERT created to predict the next sentence given the current sentence. Thus, to make the network aware of this, they inserted a [CLS] token in the beginning of the first sentence then they add [SEP] token to separate the first…

No module named ‘folium’ after installing via pip

Basically after I have already installed folium with pip (pip install folium) previously the code worked, but suddenly I got this error. Here is my code: Answer 2 possibilities come to my mind: the first one, cited by Paul, is that you installed it with pip (for Python 2) and you try using it with Python 3 (s…

Differentiate class and object in Python type hints

Django’s post_save signal sends a model class argument – sender – along with the actual instance being saved – instance. Is there a way to differentiate between the two in type hints? Example We have a model User and would like to create a post_save signal: As you can see, I have given both sender and i…