Python Forum
Grabbing comma separed values from SQLite and putting them in a list
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Grabbing comma separed values from SQLite and putting them in a list
#5
(Apr-10-2020, 06:37 AM)buran Wrote:
(Apr-10-2020, 06:28 AM)PythonNPC Wrote: I thought about fixing the DB, but there's can be variable number of floats.
In a relational database, you would have separate table with one-to-many relationship. Each value will be in separate row. And you will have a field that will link each of them to respective record in the main table.
Of course you can have everything in one table, again each value on separate row, but in this case you will repeat all other fields in the record, which is not advisable


In the current setup, as I already explained, you can split the string at commas and cast each element to int


Yes, I have given a thought to that approach as well.

According to you, what would be the better approach? Comma separated values or a separate table?

The end goal is stability and less load on the Raspberry Pi because the Raspberry Pi will be running on a battery and want it to last long by reducing load on the processor.
Reply


Messages In This Thread
RE: Grabbing comma separed values from SQLite and putting them in a list - by PythonNPC - Apr-10-2020, 07:39 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Assigning cycle values in a list nmancini 3 966 Sep-16-2024, 09:35 PM
Last Post: deanhystad
  remove duplicates from dicts with list values wardancer84 27 5,593 May-27-2024, 04:54 PM
Last Post: wardancer84
  Copying the order of another list with identical values gohanhango 7 2,525 Nov-29-2023, 09:17 PM
Last Post: Pedroski55
  Search Excel File with a list of values huzzug 4 2,774 Nov-03-2023, 05:35 PM
Last Post: huzzug
  Comparing List values to get indexes Edward_ 7 3,309 Jun-09-2023, 04:57 PM
Last Post: deanhystad
  Adding values with reduce() function from the list of tuples kinimod 10 5,384 Jan-24-2023, 08:22 AM
Last Post: perfringo
  user input values into list of lists tauros73 3 1,950 Dec-29-2022, 05:54 PM
Last Post: deanhystad
  [SOLVED] [BeautifulSoup] Turn select() into comma-separated string? Winfried 0 1,902 Aug-19-2022, 08:07 PM
Last Post: Winfried
  How to format Excel column with comma? dee 0 1,985 Jun-13-2022, 10:11 PM
Last Post: dee
  Help with subtracting values using SQLite & Python Extra 10 5,360 May-10-2022, 08:36 AM
Last Post: ibreeden

Forum Jump:

User Panel Messages

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