How to convert pandas dataframe to numpy array?

0 votes

I have two dataframes df and df2. One of them has data of same datatype and the other has data of different datatypes. I want to convert these dataframe to numpy array. How can I do this for dataframe with same datatype and different dataypes. 

May 12 in Python by Isha
47 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Irrespective of whether the dataframe has similar datatypes or not, you can the below method:

df.to_numpy()
answered May 12 by Rishi

Related Questions In Python

0 votes
1 answer

How to convert a Pandas GroupBy object to DataFrame in Python

g1 here is a DataFrame. It has a hierarchical index, ...READ MORE

answered Nov 12, 2018 in Python by Nymeria
• 3,500 points
2,479 views
0 votes
1 answer
0 votes
1 answer

How to save Numpy array as image in python?

If you have matplotlib, you can do: import ...READ MORE

answered Nov 16, 2018 in Python by Nymeria
• 3,500 points
600 views
0 votes
1 answer

How to print pandas Dataframe without index?

You can print the dataframe without index ...READ MORE

answered Mar 28 in Python by Shri
75 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to display column names of Pandas Dataframe?

Suppose the name of your dataframe is df, ...READ MORE

answered May 12 in Python by Tony
7 views
0 votes
1 answer

How to print the index of a Pandas Dataframe?

You can do this using the code ...READ MORE

answered May 12 in Python by Usha
10 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.