Python Forum
Change a numpy array to a dataframe
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change a numpy array to a dataframe
#3
I am doing it for consistency. At first, I tried to just use
convert to csv. I got the error you see. It is not a dataframe the command fails.

The solution-change to a dataframe. That seem simple and easy. What is wrong with that?

Now, I am using the command

df =pd.Dataframe(locals()[ndarray_name])

I have not converted a numpy array to a dataframe in a while do I forgot the syntax. Do I use locals or globals to make the conversion?

Also, understand that I am just being consistent in saving thing as a csv file.

Help appreciated.

Led_Zeppelin
Reply


Messages In This Thread
RE: Change a numpy array to a dataframe - by Led_Zeppelin - Jan-26-2023, 07:10 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Elegant way to apply each element of an array to a dataframe? sawtooth500 7 510 Mar-29-2024, 05:51 PM
Last Post: deanhystad
  Convert numpy array to image without loading it into RAM. DreamingInsanity 7 5,973 Feb-08-2024, 09:38 AM
Last Post: paul18fr
  IPython errors for numpy array min/max methods muelaner 1 614 Nov-04-2023, 09:22 PM
Last Post: snippsat
  Expand the range of a NumPy array? PythonNPC 0 785 Jan-31-2023, 02:41 AM
Last Post: PythonNPC
  from numpy array to csv - rounding SchroedingersLion 6 2,295 Nov-14-2022, 09:09 PM
Last Post: deanhystad
  How to change UTC time to local time in Python DataFrame? SamKnight 2 1,667 Jul-28-2022, 08:23 AM
Last Post: Pedroski55
  numpy.array has no attribute head Led_Zeppelin 1 1,299 Jul-13-2022, 12:56 AM
Last Post: Led_Zeppelin
  Seeing al the data in a dataframe or numpy.array Led_Zeppelin 1 1,187 Jul-11-2022, 08:54 PM
Last Post: Larz60+
  array change svm 6 1,564 Jun-23-2022, 01:01 PM
Last Post: svm
  go over and search in numpy array faster caro 7 1,873 Jun-20-2022, 04:54 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020