title: How to store the output of case folding into data frame or list in Python?
body: <p>So I built up the function for Case Folding and Stemming, but the output is not what I wanted. This is the case of Text pre-Processing in Bahasa Indonesia, but you don't need to understand the language, my question is the format of the output. The code is shown below :</p>
  <pre><code>import re 
  import string
  
  #import StemmerFactory class
  from Sastrawi.Stemmer.StemmerFactory import StemmerFactory
  
  #create stemmer
  factory = StemmerFactory()
  stemmer = factory.create_stemmer()
  
  def case_fold(data, title = None):
          text = &quot; &quot;.join(words for words in data)
          text = text.lower() #lowercase
          text = re.sub(r&quot;\d+&quot;, &quot;&quot;, text) #remove numbers
          text = text.translate(str.maketrans(&quot;&quot;,&quot;&quot;,string.punctuation)) #remove punctuation
          text = text.strip() #remove whitepace
          text = stemmer.stem(text) #stemming
          return text
  </code></pre>
  <p>I input the data like this</p>
  <pre><code>import pandas as pd
  
  cars = {'Brand': ['Ini &amp;Adalah [contoh]56 kalimat 57?','dengan} tanda. baca?!','seharusnya sih bagus tapi jelek !!!','Audi A4'],
          'Price': [22000,25000,27000,35000]
          }
  df = pd.DataFrame(cars, columns = ['Brand', 'Price'])
  
  print(case_fold(df['Brand']))
  </code></pre>
  <p>I got the output like this :</p>
  <pre><code>ini adalah contoh kalimat dengan tanda baca harus sih bagus tapi jelek audi a
  </code></pre>
  <p>While the output that I need is data frame like this :</p>
  <pre><code>                        Brand  
  0   ini adalah contoh kalimat 
  1           dengan tanda baca  
  2  harus sih bagus tapi jelek  
  3                      audi a  
  </code></pre>
  <p>or list like this :</p>
  <pre><code>[ini adalah contoh kalimat',
   'dengan tanda baca',
   'harus sih bagus tapi jelek',
   'audi a']
  </code></pre>
  <p>Thank you so much for helping me, I work on this for hours, Because I not often build function by myself.</p>