How to capture a CSV file and read it into a Pandas Dataframe?

Skip Montanaro skip.montanaro at gmail.com
Wed Apr 5 12:19:00 EDT 2017


I'm not positive, but try passing response to read_csv() instead of reading
the bytes yourself.

Skip

On Apr 5, 2017 10:38 AM, "David Shi via Python-list" <python-list at python.org>
wrote:

>
>
> I tried the following codes:
> import urllib2response = urllib2.urlopen('http://cordis.europa.eu/search/
> result_en?q=uk&format=csv')myCSV = response.read()
> myFile = pd.read_csv(myCSV)
>
> but, it did not work well.
> Can any one help?
> Regards.
> David
> --
> https://mail.python.org/mailman/listinfo/python-list
>


More information about the Python-list mailing list