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
  Copying the order of another list with identical values gohanhango 7 1,172 Nov-29-2023, 09:17 PM
Last Post: Pedroski55
  Search Excel File with a list of values huzzug 4 1,266 Nov-03-2023, 05:35 PM
Last Post: huzzug
  Comparing List values to get indexes Edward_ 7 1,190 Jun-09-2023, 04:57 PM
Last Post: deanhystad
  Adding values with reduce() function from the list of tuples kinimod 10 2,682 Jan-24-2023, 08:22 AM
Last Post: perfringo
  user input values into list of lists tauros73 3 1,078 Dec-29-2022, 05:54 PM
Last Post: deanhystad
  [SOLVED] [BeautifulSoup] Turn select() into comma-separated string? Winfried 0 1,126 Aug-19-2022, 08:07 PM
Last Post: Winfried
  How to format Excel column with comma? dee 0 1,378 Jun-13-2022, 10:11 PM
Last Post: dee
  Help with subtracting values using SQLite & Python Extra 10 3,428 May-10-2022, 08:36 AM
Last Post: ibreeden
  decimal comma DPaul 9 2,300 Feb-22-2022, 12:25 PM
Last Post: DeaD_EyE
  AttributeError: 'list' object has no attribute 'values' ilknurg 4 15,036 Jan-19-2022, 08:33 AM
Last Post: menator01

Forum Jump:

User Panel Messages

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