I can't think of a good topic , Just make do with it , Anyway pandas Various tossing data
data = pd.read_csv('new_jn_data.csv')
data['date'] = data['ctime'].str.split(' ',1).apply(lambda x:x[0])
data['date'] = data['date'].str.replace('/','-')
data['date'] = pd.to_datetime(data['date'])
data['data'] = data['data'].str.replace(',','').astype(float)
data['start_time']=data['ctime'].str.split(' ',1).apply(lambda x:x[1].split(':',1)[0]).astype(int)
# For the convenience of sorting sequence , According to the first cell From small to large , Then arrange by date , Are in increasing order
data = data[['date','start_time','cell','enodeb','data','sub_net','ne']].sort_values(by='date').sort_values(by='cell')
# Index rearrangement
data = data.reset_index(drop=True)
# Save the data
# data.to_csv('new_jn_data_with_nan.csv',index=0)
# Remove containing nan The line of .
data2 = data.dropna(axis=0,how='any')
# Save the data , But the index is still data The index of , If you want to rebuild the index, you can :data2 = data.dropna(axis=0,how='any').reset_index(drop=True)
# data2.to_csv('new_jn_data_exclude_nan.csv',index=0)