Skip to content
Advertisement

Split a large pandas dataframe

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

JavaScript

How to split this dataframe in to 4 groups?

Advertisement

Answer

Use np.array_split:

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement