Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

regex library with def (apply , lambda)

import re # Regular Expression *** regex *** is powerful library for string operation ..
def alphanumeric(x):
  return re.sub('[^A-Za-z0-9]+',' ',(str(x)))# here the sting operation for x in the alphanumeric(x) ** i guessed **
data_1['Model'] = data_1.Model.apply(lambda x: alphanumeric(x))# Here x: for assigning the x value of alphanumeric(x) ** i guessed **
# Each value from 'Model' column gets passed through the alphanumeric function
Source by colab.research.google.com #
 
PREVIOUS NEXT
Tagged: #regex #library #def
ADD COMMENT
Topic
Name
8+4 =