gatsoulis / a_little_book_of_python_for_multivariate_analysis Goto Github PK
View Code? Open in Web Editor NEWA Little Book of Python for Multivariate Analysis
A Little Book of Python for Multivariate Analysis
From email I received.
"""
I found an error in your book on multivariate analysis. The following line in the def pca_summary(pca, standardised_data, out=True): section should be changed to allow zip to be used in creating a dataframe.
pd.DataFrame(zip(a, b, c), index=names, columns=columns) -> pd.DataFrame(list(zip(a, b, c)), index=names, columns=columns)
Thanks for this nice little writeup!
"""
Tried:
As i am a bit new to python not sure why i get this error for my dataset? Please help out
pd.tools.plotting.scatter_matrix(data.loc[:, "V2":"V6"], diagonal="kde")
plt.tight_layout()
plt.show()
ValueError Traceback (most recent call last)
in ()
----> 1 pd.tools.plotting.scatter_matrix(data.loc[:, "V10":"V10"], diagonal="kde")
2 #plt.tight_layout()
3 #plt.show()
/home/hs/dl160_bkp/perf_engg/anaconda2/lib/python2.7/site-packages/pandas/tools/plotting.pyc in wrapper(*args, **kwargs)
15 "import 'pandas.plotting.{t}' instead.".format(t=t),
16 FutureWarning, stacklevel=2)
---> 17 return getattr(_plotting, t)(*args, **kwargs)
18 return wrapper
19
/home/hs/dl160_bkp/perf_engg/anaconda2/lib/python2.7/site-packages/pandas/plotting/_misc.pyc in scatter_matrix(frame, alpha, figsize, ax, grid, diagonal, marker, density_kwds, hist_kwds, range_padding, **kwds)
58 naxes = n * n
59 fig, axes = _subplots(naxes=naxes, figsize=figsize, ax=ax,
---> 60 squeeze=False)
61
62 # no gaps between subplots
/home/hs/dl160_bkp/perf_engg/anaconda2/lib/python2.7/site-packages/pandas/plotting/_tools.pyc in _subplots(naxes, sharex, sharey, squeeze, subplot_kw, ax, layout, layout_type, **fig_kw)
236
237 # Create first subplot separately, so we can share it if requested
--> 238 ax0 = fig.add_subplot(nrows, ncols, 1, **subplot_kw)
239
240 if sharex:
/home/hs/dl160_bkp/perf_engg/anaconda2/lib/python2.7/site-packages/matplotlib/figure.pyc in add_subplot(self, *args, **kwargs)
1237 self._axstack.remove(ax)
1238
-> 1239 a = subplot_class_factory(projection_class)(self, *args, **kwargs)
1240 self._axstack.add(key, a)
1241 self.sca(a)
/home/hs/dl160_bkp/perf_engg/anaconda2/lib/python2.7/site-packages/matplotlib/axes/_subplots.pyc in init(self, fig, args, **kwargs)
65 raise ValueError(
66 ("num must be 1 <= num <= {maxn}, not {num}"
---> 67 ).format(maxn=rowscols, num=num))
68 self._subplotspec = GridSpec(
69 rows, cols, figure=self.figure)[int(num) - 1]
ValueError: num must be 1 <= num <= 0, not 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.