Value Error: Index Must be Monotonic Increasing or Decreasing

ser3 = Series(['USA','Mexico','Canada'],index = ['0','5','10']) here ranger = range(15) I get an error while using Forward fill in iPython ser3.reindex(ranger,method = 'ffill') /Users/varun/anaconda/lib/python2.7/site-packages/pandas/core/index.pyc in _searchsorted_monotonic(self, label, side) 2395 return len(self) -…

1 Comment

Append Data Frames with Different Column Names Pandas

Have 3 dataframes which can be generated from the code shown below df1= pd.DataFrame({'person_id':[1,2,3],'gender': ['Male','Female','Not disclosed'],'ethn': ['Chinese','Indian','European']}) df2= pd.DataFrame({'pers_id':[4,5,6],'gen': ['Male','Female','Not disclosed'],'ethnicity': ['Chinese','Indian','European']}) df3= pd.DataFrame({'son_id':[7,8,9],'sex': ['Male','Female','Not disclosed'],'ethnici': ['Chinese','Indian','European']}) Would like to…

0 Comments