Python Forum

Full Version: df vs. array
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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.
(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?
(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?
(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.