Answers for "df.plot in python"

11

plot a pandas dataframe matplotlib

import pandas as pd
import matplotlib.pyplot as plt
df = pd.Dataframe(Data)
df.plot(kind='bar',x="dataframe_1",y="dataframe_2") # bar can be replaced by 
# scatter or line or even left as default
plt.show()
Posted by: Guest on March-19-2021
1

scatter plot of a dataframe in python

>>> ax2 = df.plot.scatter(x='length',
...                       y='width',
...                       c='species',
...                       colormap='viridis')
Posted by: Guest on December-17-2020

Python Answers by Framework

Browse Popular Code Answers by Language