import pandas as pd
import numpy as np
df = pd.DataFrame(np.random.randn(5, 4))
import matplotlib as mpl
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
x = df.columns
y = df.index
X, Y = np.meshgrid(x, y)
Z = df
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.plot_surface(X, Y, Z)
Matplotlib 3D surface plot from 2D pandas dataframe