## Yummy 3D plots

Very nice interactive 3D plots with Plotly. import plotly.graph_objects as go import numpy as np import pandas as pd # Read data from a csv …

Skip to content
# Category: Analytics

## Yummy 3D plots

## How to fill missing dates in Pandas

## Cosine similarity in Python

## How to explore two-dimensional data with a heatmap

## How to display a Choropleth map in Jupyter Notebook

## (Integer) Linear Programming in Python

## How to select top-k items from each group in SQL

trying stuff with code

Very nice interactive 3D plots with Plotly. import plotly.graph_objects as go import numpy as np import pandas as pd # Read data from a csv …

Create a pandas dataframe with a date column: import pandas as pd import datetime TODAY = datetime.date.today() ONE_WEEK = datetime.timedelta(days=7) ONE_DAY = datetime.timedelta(days=1) …

Cosine similarity is the normalised dot product between two vectors. I guess it is called “cosine” similarity because the dot product is the product of …

https://seaborn.pydata.org/generated/seaborn.heatmap.html

Here is the code: %matplotlib inline import geopandas as gpd import matplotlib as mpl # make rcParams available (optional) mpl.rcParams[’figure.dpi’]= 144 # increase dpi (optional) …

Step one: brew install glpk pip install pulpbrew install glpk pip install pulp Step two: from pulp import * prob = LpProblem("test1", LpMinimize) …

Here is an analytical query that you (and I) will often need to do if you work in e-commerce, marketing or similar domain. It answers …