tegge-classroom / STAT2984-2018

STAT 2984: Statistical Programming I - Spring 2018
1 stars 13 forks source link

Reading in the Data #33

Closed abbyt99 closed 6 years ago

abbyt99 commented 6 years ago

I am trying to read in the data and it keeps giving me an error that it cannot convert a string to a float.

cahicks commented 6 years ago

In order for me to be able to read the data, I had to first import some things like this import matplotlib.pyplot as plt from matplotlib.mlab import csv2rec from matplotlib.cbook import get_sample_data

And then: filename = "hurricanes-2015.txt"

then : read_data = csv2rec(filename) Nothing came up afterwards, so I assumed it was correct. I hope this helped!

nanaa9 commented 6 years ago

I read in my data using the read function

Ex: var_name = open(filename, 'r').readlines() var_name = var_name[0].split('\r') For this data set the deliminator is a return character so I split by '\r'