Skip to content

Profile Picture
Mobile
  • All
  • Search
  • Images
  • Videos
  • Maps
  • News
  • More
    • Shopping
    • Flights
    • Travel
    • Hotels
  • Tools
About 376,000 results
Open links in new tab
Any time
  1. stackoverflow.com
    https://stackoverflow.com › questions

    Creating a Pandas DataFrame from a Numpy array: How do I specify …

    Dec 24, 2013 · Specify data, index and columns to the DataFrame constructor, as follows: >>> pd.DataFrame(data=data[1:,1:], # values ... index=data[1:,0], # 1st column as index ...

  2. geeksforgeeks.org
    https://www.geeksforgeeks.org › python › create-a-data...

    Create a DataFrame from a Numpy array and specify the index column …

    Jul 28, 2020 · Let us see how to create a DataFrame from a Numpy array. We will also learn how to specify the index and the column headers of the DataFrame. Approach : Import the Pandas …

  3. slingacademy.com
    https://www.slingacademy.com › article

    Pandas: Create a DataFrame from a NumPy 2-dimensional array …

    Feb 19, 2024 · In this tutorial, you’ll learn how to seamlessly create a Pandas DataFrame from a NumPy 2-dimensional array and add column names to it. By integrating these two libraries, …

  4. saturncloud.io
    https://saturncloud.io › blog › creating-a-pandas-data...

    Creating a Pandas DataFrame from a Numpy array How do I specify …

    Jun 19, 2023 · In summary, creating a Pandas DataFrame from a Numpy array is a straightforward process that can be done using the pd.DataFrame() function. We can specify …

  5. sqlpey.com
    https://sqlpey.com › python

    Top 4 Ways to Create a Pandas DataFrame from a Numpy Array

    Dec 5, 2024 · To create a DataFrame from a Numpy array and specify index and column names explicitly, you can use: import pandas as pd. data = np.array([[5.8, 2.8], [6.0, 2.2]]) dataset = …

  6. geeksforgeeks.org
    https://www.geeksforgeeks.org › python › create-a...

    Create a Pandas DataFrame from a Numpy array and specify the index ...

    Aug 21, 2020 · This article demonstrates multiple examples to convert the Numpy arrays into Pandas Dataframe and to specify the index column and column headers for the data frame.

  7. stackoverflow.com
    https://stackoverflow.com › questions

    Create pandas dataframe from numpy array - Stack Overflow

    May 24, 2018 · To create a pandas dataframe from numpy I can use : columns = ['1','2'] data = np.array ( [ [1,2] , [1,5] , [2,3]]) df_1 = pd.DataFrame (data,columns=columns) df_1 If I instead …

  8. postgray.com
    https://postgray.com › creating-a-pandas-dataframe...

    Creating A Pandas Dataframe From A Numpy Array How Do I Specify …

    Apr 24, 2025 · To create a dataframe from a numpy array and specify index and column names explicitly, you can use: import pandas as pd. data = np.array ( [ [5.8, 2.8], [6.0, 2.2]]) dataset = …

  9. w3resource.com
    https://www.w3resource.com › python-exercises › pandas › ...

    Pandas: Create a DataFrame from a Numpy array and specify the index ...

    May 1, 2025 · Write a Pandas program to form a DataFrame from a 2D NumPy array and then rename the index and column headers using a predefined list. Write a Pandas program to …

  10. stackoverflow.com
    https://stackoverflow.com › questions

    python - convert numpy array into dataframe - Stack Overflow

    Dec 15, 2020 · My favorite way to transform numpy arrays to pandas DataFrames is to pass the columns in a dictionary: df = pd.DataFrame({'col1':nparray[0], 'col2':nparray[1]})

  11. Some results have been removed
  12. Pagination

    • 1
    • 2
    • 3
    • 4
    • Next
      © 2025 Microsoft
      • Privacy and Cookies
      • Legal
      • Advertise
      • About our ads
      • Help
      • Feedback
      • Consumer Health Privacy
      AllPast 24 hoursPast weekPast monthPast year