In [1]:
import pandas as pd

In [2]:
# Set up paths/ os
import os
import sys

this_path=os.getcwd()
os.chdir("../data")
sys.path.insert(0, this_path)

In [3]:
infile="AutismParentMagazine-posts.csv"
df = pd.read_csv(infile,index_col=0)
df.head(2)


Out[3]:
title source category text href
0 Autism, Head Banging and other Self Harming Be... https://www.autismparentingmagazine.com/ category-applied-behavior-analysis-aba For children with autism spectrum disorder (AS... https://www.autismparentingmagazine.com/autism...
1 High Quality ABA Treatment:  What Every Parent... https://www.autismparentingmagazine.com/ category-applied-behavior-analysis-aba Dr. Stephen Shore once said “If you’ve met one... https://www.autismparentingmagazine.com/high-q...

In [4]:
df['text']=df['text'].map(lambda x: x.replace("Continue Reading",""))

In [5]:
df.loc[0,'text']


Out[5]:
'For children with autism spectrum disorder (ASD), head banging is a common way to self-soothe and communicate needs. Both neurotypical and autistic babies and toddlers seek to recreate the rhythm that stimulated their vestibular system while in utero. Other rhythmic habits that fuel a child’s kinesthetic drive include head rolling, body rocking, biting, and thumb… \n'

In [6]:
# Extract only first lines
df.loc[0,'text'][:300]


Out[6]:
'For children with autism spectrum disorder (ASD), head banging is a common way to self-soothe and communicate needs. Both neurotypical and autistic babies and toddlers seek to recreate the rhythm that stimulated their vestibular system while in utero. Other rhythmic habits that fuel a child’s kinest'

In [7]:
outfile="AutismParentMagazine-posts-clean.csv"
df.to_csv(outfile)