Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
df vs. array
#1
I'm trying to code a time-series project where I have inventory that I need to update every day based on the latest conditions.

I'm a newbie so it seems like it would be easier to keep the inventory in a dataframe with named columns and rows (I'm very familiar with Excel).

Would it be faster to maintain this as an array, though? In doing so, I don't think I can use labels like I could with the df but I can draw the structure of the array out on a sheet to remind myself what goes in which rows/columns and try to work with it as array functions rather than pandas dataframe operations.

Any thoughts would be appreciated!
Mark
Reply
#2
Once you have created a dataframe, you can simply export to most any other format you wish.
Pandas, I think, would be the the best choice.
Reply
#3
(Sep-23-2021, 04:31 PM)Larz60+ Wrote: Once you have created a dataframe, you can simply export to most any other format you wish.
Pandas, I think, would be the the best choice.

I would use pandas to work with a dataframe.

Am I wrong about using numpy to work with arrays, then, or do you think there would be no additional benefit?
Reply
#4
(Sep-23-2021, 01:59 PM)Mark17 Wrote: keep the inventory in a dataframe with named columns and rows (I'm very familiar with Excel).
Are you familiar with databases?
Reply
#5
(Sep-23-2021, 11:18 PM)SamHobbs Wrote:
(Sep-23-2021, 01:59 PM)Mark17 Wrote: keep the inventory in a dataframe with named columns and rows (I'm very familiar with Excel).
Are you familiar with databases?

A little. I don't see what the difference would be, though, between loading data into a df and retrieving from there and building a SQL database and retrieving from there.
Reply


Forum Jump:

User Panel Messages

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