|
||||||
| Software Tuning Discuss all software tuning topics. |
![]() |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Senior Member
Join Date: Jan 2015
Drives: 2013 ultramarine Scion FR-S
Location: Royal Oak, MI
Posts: 293
Thanks: 140
Thanked 137 Times in 70 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
|
Data analysis and modification with Python
I've seen a number of tools for doing data analysis on here. Most are done with spreadsheets, which aren't conducive to large amounts of data. Others are written in Java, or .NET, which isn't bad, but isn't conducive to the end user wanting to learn not just what the tool does but how it does it.
Python is, by its nature, a human readable language, so I'd like to share with you how to do some data analysis in Python. If you're running Linux you probably already have Python. We need the libraries called pandas and bokeh. I assume, since you are running Linux, that you know how to get these. I prefer using Python3. If you're running anything else you can get an all-inclusive package called Anaconda which pulls everything in for you. Anaconda includes several environments for playing with Python. I prefer Spyder, as it has a variable explorer similar to MatLab. Think of it as being a MatLab environment, but better, because it's not MatLab. Once you've got everything up, fire up Spyder. Throw this into the left pane and hit the green arrow. You'll want to edit line 13 to point to the log you'd like to use. Line 15 is the X axis of the graph. Line 16 is the Y axis. Code:
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 9 22:06:52 2015
@author: jeff
"""
import pandas as pd
from bokeh.plotting import figure, HBox, output_file, show, VBox
output_file("graph.html")
logRaw = pd.read_csv('log.csv')
p1x = logRaw['time']
p1y = logRaw['RPM']
p1 = figure(tools="pan,wheel_zoom,box_zoom,reset,save", plot_width=1024, plot_height=600)
p1.scatter(p1x, p1y, size=1, color="red", alpha=0.5)
show(VBox(HBox(p1)))
Last edited by burdickjp; 07-10-2015 at 04:51 PM. |
|
|
|
| The Following 4 Users Say Thank You to burdickjp For This Useful Post: |
|
|
#2 |
|
Senior Member
Join Date: Oct 2012
Drives: UK GT86
Location: UK
Posts: 3,040
Thanks: 185
Thanked 1,632 Times in 1,113 Posts
Mentioned: 156 Post(s)
Tagged: 1 Thread(s)
|
If I remove the top line I get this error:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 24: invalid start byte If I put the 1st line in I get: p, li { white-space: pre-wrap; } p, li { white-space: pre-wrap; } # -*- coding: utf-8 -*- ^ SyntaxError: invalid syntax
__________________
.: Stealth 86 :.
Abbey Motorsport/K47 Tuned Sprintex 210 Supercharger Kodename 47 DJ: Soundcloud / Instagram / Facebook |
|
|
|
| The Following User Says Thank You to Kodename47 For This Useful Post: | DAEMANO (07-10-2015) |
|
|
#3 | |
|
Senior Member
Join Date: Jan 2015
Drives: 2013 ultramarine Scion FR-S
Location: Royal Oak, MI
Posts: 293
Thanks: 140
Thanked 137 Times in 70 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
|
Quote:
|
|
|
|
|
| The Following User Says Thank You to burdickjp For This Useful Post: | DAEMANO (07-10-2015) |
|
|
#4 |
|
Senior Member
Join Date: Oct 2012
Drives: UK GT86
Location: UK
Posts: 3,040
Thanks: 185
Thanked 1,632 Times in 1,113 Posts
Mentioned: 156 Post(s)
Tagged: 1 Thread(s)
|
This is what I've put entered:
Code:
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 9 22:06:52 2015
@author: jeff
"""
import pandas as pd
from bokeh.plotting import figure, HBox, output_file, show, VBox
output_file("graph.html")
logRaw = pd.read_csv('C:\EcuTek\MapAccessLogs\Sprintex 70mm-01-03-2015.csv')
p1x = logRaw['Time']
p1y = logRaw['FLKC']
p1 = figure(tools="pan,wheel_zoom,box_zoom,reset,save", plot_width=1024, plot_height=600)
p1.scatter(p1x, p1y, size=1, color="red", alpha=0.5)
show(VBox(HBox(p1)))
__________________
.: Stealth 86 :.
Abbey Motorsport/K47 Tuned Sprintex 210 Supercharger Kodename 47 DJ: Soundcloud / Instagram / Facebook |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Apr 2013
Drives: 2013 FR-S
Location: Seattle
Posts: 806
Thanks: 202
Thanked 321 Times in 199 Posts
Mentioned: 18 Post(s)
Tagged: 1 Thread(s)
|
Why do you believe Python is, by its nature, a more human readable language than the other ones you mentioned (Java and C#)?
__________________
2013 Whiteout 6AT FR-S | Perrin Inlet Tube + 2.75" CAI | OpenFlash Header | P&L Catback | 4.88 Final Drive | Dialed in OFT 2.0x Stage 2 E85 | 18x8 Enkei Raijin + 225/40 Michelin Pilot Super Sport | 17x7 Stock + 215/45 Michelin X-Ice Xi-2
|
|
|
|
|
|
#6 | |
|
Senior Member
Join Date: Jan 2015
Drives: 2013 ultramarine Scion FR-S
Location: Royal Oak, MI
Posts: 293
Thanks: 140
Thanked 137 Times in 70 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
|
Quote:
There's a reason python is experiencing explosive growth in academia, science, and research. It's not necessarily on topic here, but I LOVE python and feel it's the right tool for this job. |
|
|
|
|
|
|
#7 | |
|
Senior Member
Join Date: Jan 2015
Drives: 2013 ultramarine Scion FR-S
Location: Royal Oak, MI
Posts: 293
Thanks: 140
Thanked 137 Times in 70 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
|
Quote:
|
|
|
|
|
|
|
#8 |
|
Sarcastic SOB
Join Date: May 2012
Drives: '13 FR-S M6, '23 Volvo V60 CC
Location: Thornhill Ontario
Posts: 4,643
Thanks: 1,362
Thanked 2,858 Times in 1,642 Posts
Mentioned: 32 Post(s)
Tagged: 3 Thread(s)
|
Python: the programming language for Arduino.
Some cool project ts done with it. In the pinball machine hobby there are some real magicians. A guy named Ben Heck started with hacking game consoles and then controller U its for one off custom pinball machines. Cool stuff.
__________________
5:AD kit, HKS V1+ S/C, ECUtek dyno'd, Ohlins MP20, Magnaflow cb, Revworks UEL, Topspeed overpipe, Pinnacle Ceramic tint, VG shark fin, HID's, yellow DRL's, full LEDs, red floor lights, Homelink mirror, trunk lid liner, Perrin LWCP, Valenti smoked, Flossy Grip Tape Shorty, GT86 plaque, lighted vanity mirror, Michelin PSS, Project mU +800, DOT4 fluid, 720 Form GTF1 17x8&9, stitched leather bits, EZ valve.
|
|
|
|
|
|
#9 | |
|
Senior Member
Join Date: Jan 2015
Drives: 2013 ultramarine Scion FR-S
Location: Royal Oak, MI
Posts: 293
Thanks: 140
Thanked 137 Times in 70 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
|
Quote:
Sent from my XT1045 using Tapatalk |
|
|
|
|
|
|
#10 |
|
Senior Member
Join Date: Oct 2012
Drives: UK GT86
Location: UK
Posts: 3,040
Thanks: 185
Thanked 1,632 Times in 1,113 Posts
Mentioned: 156 Post(s)
Tagged: 1 Thread(s)
|
I downloaded Python 3. I literally installed and then ran Spyder as you suggested.
__________________
.: Stealth 86 :.
Abbey Motorsport/K47 Tuned Sprintex 210 Supercharger Kodename 47 DJ: Soundcloud / Instagram / Facebook |
|
|
|
|
|
#11 |
|
Senior Member
Join Date: Oct 2011
Drives: Slowly
Location: brisbane.qld.au
Posts: 1,064
Thanks: 212
Thanked 539 Times in 235 Posts
Mentioned: 21 Post(s)
Tagged: 1 Thread(s)
|
Python is great for this kind of stuff. I use it a lot.
Sent from my Nexus 6 using Tapatalk |
|
|
|
|
|
#12 |
|
Senior Member
Join Date: Jan 2015
Drives: 2013 ultramarine Scion FR-S
Location: Royal Oak, MI
Posts: 293
Thanks: 140
Thanked 137 Times in 70 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
|
|
|
|
|
| The Following User Says Thank You to burdickjp For This Useful Post: | Kodename47 (07-11-2015) |
|
|
#13 |
|
Senior Member
Join Date: Oct 2012
Drives: UK GT86
Location: UK
Posts: 3,040
Thanks: 185
Thanked 1,632 Times in 1,113 Posts
Mentioned: 156 Post(s)
Tagged: 1 Thread(s)
|
I'm on Windows8 64 bit. Should I revert to python2?
__________________
.: Stealth 86 :.
Abbey Motorsport/K47 Tuned Sprintex 210 Supercharger Kodename 47 DJ: Soundcloud / Instagram / Facebook |
|
|
|
|
|
#14 |
|
Senior Member
Join Date: Jan 2015
Drives: 2013 ultramarine Scion FR-S
Location: Royal Oak, MI
Posts: 293
Thanks: 140
Thanked 137 Times in 70 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
|
|
|
|
|
|
|
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| BRZ MPG Data Analysis | housecat | BRZ First-Gen (2012+) — General Topics | 30 | 02-14-2016 09:32 PM |
| Recognizing Brake Fade with Data Analysis | GSpeed | Tracking / Autocross / HPDE / Drifting | 25 | 07-06-2015 01:42 AM |
| Help with School Assignment.(Programming with Python) | Zaku | Off-Topic Lounge [WARNING: NO POLITICS] | 0 | 04-09-2013 03:55 PM |
| python vinyl wrapped interior panels | Vonsamhain | Cosmetic Modification (Interior/Exterior/Lighting) | 26 | 10-14-2012 02:21 AM |
| Downloadable driving data/Toyota encourages modification | nate89 | Scion FR-S / Toyota 86 GT86 General Forum | 22 | 03-15-2012 10:12 AM |