I'm trying to run the following code, but I keep getting a Syntax Error. It runs sometimes on iPython notebook, but it's not stable.
The code is supposed to get a bubble chart of the variables set.
%matplotlib inline
import pandas as pd
import numpy as np
df = pd.read_csv('effort.csv')
df.plot(kind='scatter', x='setting', y='effort', s=df['country']*df['change']);
%matplotlib inline
is an IPython-specific directive which causes IPython to display matplotlib plots in a notebook cell rather than in another window.
To run the code as a script use
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
df = pd.read_csv('effort.csv')
df.plot(kind='scatter', x='setting', y='effort', s=df['country']*df['change'])
plt.show()
plt.show()
to display the plotIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With