Beginning Python Visualization: Crafting Visual Transformation Scripts

Page 27

C HA P TER 1 N N A V I G A T I N G T H E W O R LD O F D A T A V I S U A LI Z A T I O N

CSV is a popular format recognized by most spreadsheets and database applications and, of course, text editors, seeing as they’re really just text files. As it turns out, the data the GPS outputs is already comma separated, so all that’s required is to save this information to a file, as is.

File Naming Conventions We turn to selecting PROPER FILE NAMES FOR OUR DATA FILES &ILE NAMES SHOULD BE UNIQUE SO THAT FILES WON T BE ACCIDENTALLY OVERWRITTEN &ILE NAMES SHOULD BE DESCRIPTIVE THAT IS TELL US SOMEthing about the contents. Lastly, we’d like the file name extension to tell us how to view the file. The latter is typically achieved by selecting a proper extension, in our case, *_or. Here are the naming conventions I chose for this example:

s &ILE NAMES HOLDING '03 DATA WILL START WITH THE TEXT h'03 v

s .EXT IS THE DATE AND TIME IN )3/ FORMAT WITH THE SEPARATING COLONS OMITTED AND A hyphen between the date and time: YYYY-mm-dd-HH-MM-SS, where YYYY stands for year, mm for month, dd for day, HH for hours, MM for minutes, and SS for seconds. In case a value is one digit and two digits are required, values will be padded with zeros, FOR EXAMPLE THE MONTH OF -AY WILL BE DENOTED BY NOT &OR ADDITIONAL INFORMATION regarding the ISO format, refer to ISO 8601, “Data elements and interchange formats— Information interchange—Representation of dates and times� (dppl6++sss*eok*knc).

s !LL FILES WILL HAVE A *_or extension. &OLLOWING THESE CONVENTIONS A FILE NAME MIGHT LOOK like this:

CLO).,,4),1)/,),5)-,)1.*_or

Data Location This is where we store data files:

s !LL DATA FILES ARE STORED IN DIRECTORY `]p]. All scripts are stored in directory on_. Both directories are under the same parent directory ?d-. So a relative path from on_ to `]p] is **+`]p].

s )T S A GOOD IDEA to also add a Na]`ia*ptp file. Readme files are clear text files describing the contents of a directory, in as much detail as deemed reasonable: the data source, data acquisition system, person in charge of data gathering, reason for gathering the data, and so on. Here’s an example:

@]p] na_kn`a` bnki ] QO> CLO na_aeran( _kjja_pa` pk ] Hajkrk h]lpkl P2,* @]p] s]o c]pdana` re] pda oane]h lknp opkna` pk _ha]n patp behao $?OR%* Ia]oqnaiajpo sana p]gaj pk aopei]pa olaa` ]j` peia olajp ej pn]bbe_* C]pdana` ^u Od]e R]ejc]op* @]pa6 pdnkqcdkqp .,,4( oaa beha peiaop]ilo*

7


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.