OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Split a large pandas dataframe

  • Thread starter Thread starter Nilani Algiriyage
  • Start date Start date
N

Nilani Algiriyage

Guest
I have a large dataframe with 423244 lines. I want to split this in to 4. I tried the following code which gave an error? ValueError: array split does not result in an equal division

Code:
for item in np.split(df, 4):
    print item

How to split this dataframe in to 4 groups?
<p>I have a large dataframe with 423244 lines. I want to split this in to 4. I tried the following code which gave an error? <code>ValueError: array split does not result in an equal division</code></p>

<pre><code>for item in np.split(df, 4):
print item
</code></pre>

<p>How to split this dataframe in to 4 groups?</p>
 
Top