Login required to started new threads

Login required to post replies

Re: Learning a programming language - what to pick [347CX]
347CX wrote:
Yeah, I've got pandas and put the data stream into a dataframe. The snag I'm encountering is that the stream is being pulled as a dictionary first, so brief example {"time":{"0"[0, 1, 2]}, "watts":{"0"[164, 156, 157]} }, and the issue is that all the time, watts, and heartrate data are being put into individual cells in excel/csv. So columns time, watts, heartrate, and one row 0 (hope that makes sense). If the structure could be {"time":[0,1,2], "watts":[164, 156, 157]} it would deliver the output in a way that can be used for plotting. So that's my newbie hurdle at the moment lol

I haven't gotten my stuff on github, but stravalib is located here https://github.com/hozn/stravalib and has a lot of documentation to it


It's hard to tell what the dictionary looks like. Based on what you wrote, my first impression would be to read the dictionary as a string and strip out a few things like the '{"0"' so that would be something like a str.replace('{"0"',""). You'd have to strip up out the trailing brace as well. str.replace("]}","]"). That would leave the data as a list which ought to be easier to deal with.

That said, there's probably a cleaner way to do this rather than dealing with replacing characters in a string.
Last edited by: riotgear: Jan 21, 20 8:42

Edit Log:

  • Post edited by riotgear (Dawson Saddle) on Jan 21, 20 8:42