Energy Consumption By Mode Of Transportation

JohnSnowLabs

Files Size Format Created Updated License Source
2 109kB csv zip 3 months ago John Snow Labs Standard License John Snow Labs Bureau of Transportation Statistics
Download

Data Files

File Description Size Last changed Download
energy-consumption-by-mode-of-transportation-csv 4kB csv (4kB) , json (40kB)
energy-consumption-by-mode-of-transportation_zip Compressed versions of dataset. Includes normalized CSV and JSON data with original data and datapackage.json. 10kB zip (10kB)

energy-consumption-by-mode-of-transportation-csv  

This is a preview version. There might be more data in the original version.

Field information

Field Name Order Type (Format) Description
Year 1 date (%Y-%m-%d) Year of Data
Enery_Consumption_In_Air_Mode_In_Certified_Carrier_Jet_Fuel 2 integer Total energy consumption in certified carrier for domestic operations alone
Enery_Consumption_In_Air_Mode_In_Aviation_Gasoline 3 integer Total energy consumption of aviation gasoline
Enery_Consumption_In_Air_Mode_In_General_Aviation_Jet_Fuel 4 integer Total energy consumption in general aviation, includes fuel used in air taxi operations, but not commuter operations.
Enery_Consumption_In_Highway_Light_Vehicle_Short_Wheelbase_Motorcycle 5 integer Energy consumption in highway for light duty vehicle with short wheel base. Data for 2007-13 were calculated using a new methodology developed by FHWA. Data for these years are based on new categories and are not comparable to previous years. The new category Light duty vehicle, short wheel base includes passenger cars, light trucks, vans and sport utility vehicles with a wheelbase (WB) equal to or less than 121 inches. The new category Light duty vehicle, long wheel base includes large passenger cars, vans, pickup trucks, and sport/utility vehicles with wheelbases (WB) larger than 121 inches. In addition, this edition of table 4-06 is not comparable to previous editions.
Enery_Consumption_In_Highway_Mode_In_Light_Vehicle_Long_Wheelbase 6 integer Energy consumption in highway for light duty vehicle with long wheel base. Data for 2007-13 were calculated using a new methodology developed by FHWA. Data for these years are based on new categories and are not comparable to previous years. The new category Light duty vehicle, short wheel base includes passenger cars, light trucks, vans and sport utility vehicles with a wheelbase (WB) equal to or less than 121 inches. The new category Light duty vehicle, long wheel base includes large passenger cars, vans, pickup trucks, and sport/utility vehicles with wheelbases (WB) larger than 121 inches. In addition, this edition of table 4-06 is not comparable to previous editions.
Enery_Consumption_Highway_Mode_Single_Unit_2_Axle_6_Tyre_Or_More_Truck 7 integer Energy consumption in highway for single unit 2 axle 6 tyre or more truck. 1965 data includes other 2-axle 4-tire vehicles.
Enery_Consumption_In_Highway_Mode_In_Combination_Truck 8 integer Energy consumption in highway combination trucks
Enery_Consumption_In_Highway_Mode_In_Bus 9 integer Energy consumption in highway for bus
Enery_Consumption_In_Transite_Mode_In_Electricity 10 integer Energy consumption in transit mode for electricity. Data from 1997-2013 are not comparable to data before 1997 due to different sources. Prior to 1984, excludes commuter rail, automated guideway, ferryboat, demand responsive vehicles, and most rural and smaller systems.
Enery_Consumption_In_Motor_Fuel_Mode_In_Diesel 11 integer Energy consumption in mototr fuel mode for diesel. Diesel includes Diesel and Bio-Diesel.
Enery_Consumption_In_Motor_Fuel_Mode_Gasoline_And_Other_Nondiesel_Fuel 12 integer Energy consumption in Gasoline and all other nondiesel fuels include Gasoline, Liquified Petroleum Gas, Liquified Natural Gas, Methane, Ethanol, Bunker Fuel, Kerosene, Grain Additive, and Other Fuel.
Enery_Consumption_In_Motor_Fuel_Mode_In_Compressed_Natural_Gas 13 integer Energy consumption in motor fuel mode of transport for natural gas
Enery_Consumption_Rail_Class1_Freight_Mode_In_Distillate_Diesel_Fuel 14 integer Energy consumption in rail freight mode for distillate diesel fuel
Enery_Consumption_In_Amtrak_Mode_In_Electricity 15 integer Energy consumption in Amtrak mode of transport for electricity
Enery_Consumption_In_Amtrak_Mode_In_Distillate_Or_Diesel_Fuel 16 integer Energy consumption in Amtrak mode of transport for electricity
Enery_Consumption_In_Water_Mode_In_Residual_Fuel_Oil 17 integer Energy consumption in water mode of transport for residual fuel oil
Enery_Consumption_In_Water_Mode_In_Distillate_Or_Diesel_Fuel_Oil 18 integer Energy consumption in water mode of transport for distillate or diesel fuel oil
Enery_Consumption_In_Water_Mode_In_Gasoline 19 integer Energy consumption in water mode of transport for gasoline
Enery_Consumption_In_Pipeline_Mode_In_Natural_Gas 20 integer Energy consumption in pipeline mode for natural gas

Import into your tool

Data-cli or just data is the program to get and post your data with the datahub.
Use data with the datahub.io almost like you use git with the github. Here are installation instructions.

data get https://datahub.io/JohnSnowLabs/energy-consumption-by-mode-of-transportation
tree JohnSnowLabs/energy-consumption-by-mode-of-transportation
# Get a list of dataset's resources
curl -L -s https://datahub.io/JohnSnowLabs/energy-consumption-by-mode-of-transportation/datapackage.json | grep path

# Get resources

curl -L https://datahub.io/JohnSnowLabs/energy-consumption-by-mode-of-transportation/r/0.csv

curl -L https://datahub.io/JohnSnowLabs/energy-consumption-by-mode-of-transportation/r/1.zip

If you are using R here's how to get the data you want quickly loaded:

install.packages("jsonlite", repos="https://cran.rstudio.com/")
library("jsonlite")

json_file <- 'https://datahub.io/JohnSnowLabs/energy-consumption-by-mode-of-transportation/datapackage.json'
json_data <- fromJSON(paste(readLines(json_file), collapse=""))

# get list of all resources:
print(json_data$resources$name)

# print all tabular data(if exists any)
for(i in 1:length(json_data$resources$datahub$type)){
  if(json_data$resources$datahub$type[i]=='derived/csv'){
    path_to_file = json_data$resources$path[i]
    data <- read.csv(url(path_to_file))
    print(data)
  }
}

Note: You might need to run the script with root permissions if you are running on Linux machine

Install the Frictionless Data data package library and the pandas itself:

pip install datapackage
pip install pandas

Now you can use the datapackage in the Pandas:

import datapackage
import pandas as pd

data_url = 'https://datahub.io/JohnSnowLabs/energy-consumption-by-mode-of-transportation/datapackage.json'

# to load Data Package into storage
package = datapackage.Package(data_url)

# to load only tabular data
resources = package.resources
for resource in resources:
    if resource.tabular:
        data = pd.read_csv(resource.descriptor['path'])
        print (data)

For Python, first install the `datapackage` library (all the datasets on DataHub are Data Packages):

pip install datapackage

To get Data Package into your Python environment, run following code:

from datapackage import Package

package = Package('https://datahub.io/JohnSnowLabs/energy-consumption-by-mode-of-transportation/datapackage.json')

# print list of all resources:
print(package.resource_names)

# print processed tabular data (if exists any)
for resource in package.resources:
    if resource.descriptor['datahub']['type'] == 'derived/csv':
        print(resource.read())

If you are using JavaScript, please, follow instructions below:

Install data.js module using npm:

  $ npm install data.js

Once the package is installed, use the following code snippet:

const {Dataset} = require('data.js')

const path = 'https://datahub.io/JohnSnowLabs/energy-consumption-by-mode-of-transportation/datapackage.json'

// We're using self-invoking function here as we want to use async-await syntax:
;(async () => {
  const dataset = await Dataset.load(path)
  // get list of all resources:
  for (const id in dataset.resources) {
    console.log(dataset.resources[id]._descriptor.name)
  }
  // get all tabular data(if exists any)
  for (const id in dataset.resources) {
    if (dataset.resources[id]._descriptor.format === "csv") {
      const file = dataset.resources[id]
      // Get a raw stream
      const stream = await file.stream()
      // entire file as a buffer (be careful with large files!)
      const buffer = await file.buffer
      // print data
      stream.pipe(process.stdout)
    }
  }
})()
Datapackage.json