Navigation

    Cyberian
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Pro Blog
    • Users
    • Groups
    • Unsolved
    • Solved
    1. Home
    2. Tags
    3. python
    Log in to post
    • All categories
    • sweet friends

      SOLVED How to iterate over every n-th line from a file?
      Development Troubleshooting • every n-th line iterate n-th line over every python • • sweet friends

      2
      0
      Votes
      2
      Posts
      508
      Views

      zaasmi

      Demo:

      data.txt:

      line1 line2 line3 line4 line5 line6 line7 line8 line9 line10 line11 line12 line13

      Code:

      from itertools import islice with open('data.txt') as f: for line in islice(f, 3, None, 3): print line, # Python3: print(line, end='')

      Produces:

      line4 line7 line10 line13

      Reff

    • wafa sehar

      SOLVED How do you fix “runtimeError: package fails to pass a sanity check” for numpy and pandas?
      Troubleshooting • runtimeerror package fails python python-3.x windows • • wafa sehar

      2
      0
      Votes
      2
      Posts
      542
      Views

      zaasmi

      @wafa-sehar said in How do you fix “runtimeError: package fails to pass a sanity check” for numpy and pandas?:

      can anyone guide me please.

      RuntimeError: The current Numpy installation ('...\\venv\\lib\\site-packages\\numpy\\__init__.py') fails to pass a sanity check due to a bug in the windows runtime.

      We have also tried multiple versions of Python (3.8.6 and 3.9.0) and numpy and pandas. I am currently using PyCharm to do all this.

      This error occurs when using python3.9 and numpy1.19.4 So uninstalling numpy1.19.4 and installing 1.19.3 will work.