0

I have one data frame and with approx 4000 rows and the spacing between the rows are not equal. So, I want to make spacing equally. for example:

len1                            len1
1.133124                        1.0
1.251545                        1.5
1.455714                        2.0
1.641502                        2.5
1.864047                        3.0
2.066187                        3.5

Like this way. Please help me, I am a beginner.

Dani Mesejo
  • 61,499
  • 6
  • 49
  • 76

1 Answers1

0

I think you mean that there are white spaces in the data? example:

             len1  
0        1.133124                    
1    1.251545                  
2      1.455714                       
3     1.641502      
4       1.864047  
5    2.066187

If this is indeed your question the following would help:

df['len1'].str.strip()

This strips the white space and would give:

         len1  
0    1.133124                    
1    1.251545                  
2    1.455714                       
3    1.641502      
4    1.864047  
5    2.066187
Hoekieee
  • 367
  • 1
  • 15