[SOLVED] from pandas import read_table

$25

File Name: from_pandas_import_read_table.zip
File Size: 273.18 KB

5/5 - (1 vote)

from pandas import read_table

def download_data(fileLocation, fields):

Downloads the data for this script into a pandas DataFrame. Uses columns indices provided

frame = read_table(
fileLocation,

# Specify the file encoding
# Latin-1 is common for data from US sources
encoding=latin-1,
#encoding=utf-8,# UTF-8 is also common

# Specify the separator in the data
sep=,,# comma separated values

# Ignore spaces after the separator
skipinitialspace=True,

# Generate row labels from each row number
index_col=None,

# Generate column headers row from each column number
header=0,# use the first line as headers

usecols=fields
)

# Return the entire frame
return frame

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] from pandas import read_table
$25