Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pd.read_csv(
- "data.csv.gz",
- delimiter = "^",
- # line numbers to skip (i.e. headers in an excel report)
- skiprows = 2,
- # used to denote the start and end of a quoted item
- quotechar = "|",
- # return a subset of columns
- usecols = ["return_date", "company", "sales"],
- # data type for data or columns
- dtype = { "sales": np.float64 },
- # additional strings to recognize as NA/NaN
- na_values = [".", "?"],
- # convert to datetime, instead of object
- parse_dates = ["return_date"],
- # for on-the-fly decompression of on-disk data
- # options - gzip, bz2, zip, xz
- compression = "gzip",
- # encoding to use for reading
- encoding = "latin1",
- # read in a subset of data
- nrows = 100
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement