Kernel: Python 3 (system-wide)
In [9]:
Out[9]:
In [1]:
Out[1]:
In [15]:
Out[15]:
In [14]:
Out[14]:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/tmp/ipykernel_414/4132333676.py in <cell line: 7>()
5 fig=plt.figure()
6 ax=fig.add_axes([0,0,1,1])
----> 7 ax.bar(x+0.15,data[1],color='blue',width=0.25)
8 ax.bar(x+0.25,data[2],color='green',width=0.25)
9 ax.bar(x+0.50,data[3],color='red',width=0.25)
/usr/local/lib/python3.8/dist-packages/matplotlib/__init__.py in inner(ax, data, *args, **kwargs)
1410 def inner(ax, *args, data=None, **kwargs):
1411 if data is None:
-> 1412 return func(ax, *map(sanitize_sequence, args), **kwargs)
1413
1414 bound = new_sig.bind(ax, *args, **kwargs)
/usr/local/lib/python3.8/dist-packages/matplotlib/axes/_axes.py in bar(self, x, height, width, bottom, align, **kwargs)
2340 yerr = self._convert_dx(yerr, y0, y, self.convert_yunits)
2341
-> 2342 x, height, width, y, linewidth, hatch = np.broadcast_arrays(
2343 # Make args iterable too.
2344 np.atleast_1d(x), height, width, y, linewidth, hatch)
<__array_function__ internals> in broadcast_arrays(*args, **kwargs)
/usr/local/lib/python3.8/dist-packages/numpy/lib/stride_tricks.py in broadcast_arrays(subok, *args)
536 args = [np.array(_m, copy=False, subok=subok) for _m in args]
537
--> 538 shape = _broadcast_shape(*args)
539
540 if all(array.shape == shape for array in args):
/usr/local/lib/python3.8/dist-packages/numpy/lib/stride_tricks.py in _broadcast_shape(*args)
418 # use the old-iterator because np.nditer does not handle size 0 arrays
419 # consistently
--> 420 b = np.broadcast(*args[:32])
421 # unfortunately, it cannot handle 32 or more arguments directly
422 for pos in range(32, len(args), 31):
ValueError: shape mismatch: objects cannot be broadcast to a single shape
In [13]:
Out[13]:
In [2]:
Out[2]:
In [1]:
Out[1]:
In [3]:
Out[3]:
In [4]:
Out[4]:
In [1]:
Out[1]:
In [2]:
Out[2]:
In [10]:
Out[10]:
In [2]:
Out[2]:
In [11]:
Out[11]:
hello matplotlib
In [12]:
Out[12]:
In [17]:
Out[17]:
hello anand
In [19]:
Out[19]:
yadav
In [3]:
Out[3]:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
/tmp/ipykernel_456/3659930258.py in <cell line: 4>()
2 from matplotlib import pyplot as plt
3
----> 4 data.head()
5 df=pd.dataframe(data)
6 name=df['car'].head(12)
NameError: name 'data' is not defined
In [3]:
Out[3]:
calories duration
0 480 60
1 320 50
2 290 30
calories 480
duration 60
Name: 0, dtype: int64
calories duration
0 480 60
1 320 50
In [6]:
Out[6]:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
/tmp/ipykernel_619/1136005278.py in <cell line: 8>()
6 fig=plt.figure(figsize=(12,8),dpi=80)
7 ax=fig.add_subplot(111,projection='3d')
----> 8 pnt3d=ax.scatter3D(data_with_dummies_without_2017
9 ['Year'],data_with_dummies_without_2017['Machine'],
10 data_with_dummies_without_2017['Grinding_Volume'],c=data_with_dummies_without_2017['Grinding_volume'])
NameError: name 'data_with_dummies_without_2017' is not defined
<Figure size 864x504 with 0 Axes>
In [0]: