Python Forum
How to automate list separation. NOOB
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to automate list separation. NOOB
#7
One buoy, two months worth, from .txt file:
https://www.ndbc.noaa.gov/view_text_file...ical/dart/
I want to paste this sort of data into a list and automate the removal of what I don't need as well as add commas to make it into a usable list which I could just plop into something like:
list1 = [4594.844,
4594.844
,4594.843
,4594.844
,4594.843
,4594.842
,4594.842]
>>> print(max(list1))
Your calculation is close.
"Snippet of code I provided is working example how to solve this type of problems. If you don't know how to use it then you should say so. Nobody is 'playing' here."
I can't tell the difference between an example and usable code. Sorry.
I have coded in HTML and CSS so when a colleague suggested I write a code in Python, I thought that that sounded great. It seemed like something I could pick up in an hour, enough anyhow to write a simple program. All I need is above, but I just need to insert commas and remove other info from the raw data. Like I said, if I could just replace spaces with commas, I could deal with the rest by scrolling, no biggie. I don't care if the dates end up as list elements, but it would be nice if they didn't.
2nd max was just a simple way to remove the 9999.000s.
Reply


Messages In This Thread
RE: How to automate list separation. NOOB - by LobateScarp - Sep-20-2019, 01:09 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] Automate the boring stuff, inserting commas in list srikanth 1 2,132 Jul-02-2019, 02:29 PM
Last Post: metulburr
  Automate the boring stuff, inserting commas in list DJ_Qu 3 4,724 Apr-21-2019, 03:52 PM
Last Post: perfringo
  1. How can I automate this batch creation of documents? 2. How can I automate posting SamLearnsPython 2 3,444 Jul-02-2018, 11:36 AM
Last Post: buran

Forum Jump:

User Panel Messages

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