Python Forum
Data types changing by itself
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Data types changing by itself
#3
(Oct-30-2023, 04:49 PM)deanhystad Wrote: loc[0] contains Tail_Number, which is not a float. A numpy array must be homogeneous, so all types are converted to object when you create the series. There are ways around this as discussed here:

https://stackoverflow.com/questions/6264...-dataframe

Maybe the slice approach will work for you as it sounds like you are reassembling the rows back into dataframes.
arr_slice = arr.loc[0:0]
reassembled_df = pd.concat([list of arr slices])

It worked, thank you for your help!
Reply


Messages In This Thread
Data types changing by itself - by dimas - Oct-30-2023, 02:25 PM
RE: Data types changing by itself - by deanhystad - Oct-30-2023, 04:49 PM
RE: Data types changing by itself - by dimas - Oct-30-2023, 06:11 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Training a model to identify specific SMS types and extract relevant data? lord_of_cinder 0 1,051 Oct-10-2022, 04:35 AM
Last Post: lord_of_cinder
  Can the data types be different for different columns? Robotguy 2 2,194 Aug-19-2020, 09:24 PM
Last Post: Robotguy
  Changing Function by Changing or without Changing its Parameters usmankhan 5 3,890 Jan-09-2018, 03:52 PM
Last Post: Windspar

Forum Jump:

User Panel Messages

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