Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Python
  3. Question
Python

stringio in python3

Asked by Rutuja Mishra Apr 11, 2021 1.4K views 1 answer
Share

About this question

I am using Python 3.2.1 and I can't import the StringIO module. I use io.StringIO and it works, but I can't use it with numpy's genfromtxt like this:

x="1 3n 4.5 8" numpy.genfromtxt(io.StringIO(x))

I get the following error: no module named 'stringio'

TypeError: Can't convert 'bytes' object to str implicitly

and when I write import StringIO it says  

ImportError: No module named 'StringIO'

Your answer

1 Answer

More Python discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Python Blogs

Guides, tips and career advice on Python from JanBask experts.