Series within dataframe are different lengths, how can I fix this?

I know this might be difficult to visualize without an example, but reproducing one for you folks would be a nightmare haha.

I am getting the below error:

ValueError: All arguments should have the same length.  The length of column argument df['color'] is 11109, whereas  the length of  previously-processed arguments   ['$_Amount','Company_Name',  'Latitude', 'Longitude', 'Funding_Program_Name'] is 11111 

Basically I am trying to plot on a scatter map some data, but one column is 2 rows shorter than the rest after plowing through the raw data. (Unsure how this happened)

I have tried .replace(np.nan,0) I have tried .dropna() Also tried .replace('',0)

I guess I cannot operate on something that doesn’t "exist" and so the above have not fixed the problem

But I think the solution would involve somehow adding cell data to the empty to slots in the [‘color’] column, and I am unsure how to do this. Any tips?!

Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.