
Interactive Visualizations with Plotly
Plotly Express, interactive charts, dashboards, animations, geographic maps, export
1What is the main difference between Plotly Express and Plotly Graph Objects?
What is the main difference between Plotly Express and Plotly Graph Objects?
Answer
Plotly Express is a high-level API that allows creating charts in a single line of code with simple parameters. Plotly Graph Objects is the low-level API offering complete control over every chart element. Plotly Express uses Graph Objects internally, which allows switching between them to further customize charts.
2How to create a scatter plot with Plotly Express from a Pandas DataFrame?
How to create a scatter plot with Plotly Express from a Pandas DataFrame?
Answer
The px.scatter() function takes a DataFrame and uses x and y parameters to specify which columns to display on each axis. This concise syntax allows quickly creating interactive visualizations without complex configuration. Optional parameters like color, size and hover_data allow enriching the chart.
3Which Plotly Express parameter allows coloring points according to a categorical variable?
Which Plotly Express parameter allows coloring points according to a categorical variable?
Answer
The color parameter in Plotly Express automatically assigns distinct colors to each unique value of a categorical variable. Plotly generates an interactive legend and uses a default color palette optimized for visual distinction. This parameter also works with numerical variables to create a color gradient.
How to display a Plotly chart in a Jupyter notebook?
How to export a Plotly chart to HTML format for sharing?
+15 interview questions
Other Data Science & ML interview topics
Python Basics
Python Object-Oriented Programming
Python Data Structures
Git Fundamentals
SQL Basics
NumPy Fundamentals
Pandas Basics
Jupyter & Google Colab
SQL Joins & Advanced Queries
Advanced Pandas
Visualization with Matplotlib & Seaborn
Descriptive Statistics
Inferential Statistics
Web Scraping
BigQuery & Cloud Data
Feature Engineering
Supervised ML: Regression
Supervised ML: Classification
Decision Trees & Ensembles
Unsupervised ML
ML Pipelines & Validation
Time Series & Forecasting
Deep Learning Fundamentals
TensorFlow & Keras
CNN & Image Classification
RNN & Sequences
Transformers & Attention
NLP & Hugging Face
GenAI & LangChain
MLOps & Deployment
Master Data Science & ML for your next interview
Access all questions, flashcards, technical tests, code review exercises and interview simulators.
Start for free