Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 676f04b

Browse filesBrowse files
committed
DOC : add examples of casting DataFrame and matrix
1 parent f4782da commit 676f04b
Copy full SHA for 676f04b

File tree

Expand file treeCollapse file tree

1 file changed

+12
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+12
-0
lines changed

‎doc/faq/usage_faq.rst

Copy file name to clipboardExpand all lines: doc/faq/usage_faq.rst
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,18 @@ input. Classes that are 'array-like' such as `pandas` data objects
124124
and `np.matrix` may or may not work as intended. It is best to
125125
convert these to `np.array` objects prior to plotting.
126126

127+
For example, to covert a `pandas.DataFrame` ::
128+
129+
a = pandas.DataFrame(np.random.rand(4,5), columns = list('abcde'))
130+
a_asndarray = a.values
131+
132+
and to covert a `np.matrix` ::
133+
134+
b = np.matrix([[1,2],[3,4]])
135+
b_asarray = np.asarray(b)
136+
137+
138+
127139
.. _pylab:
128140

129141
Matplotlib, pyplot and pylab: how are they related?

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.