title: I want to run machine learning algorithm using django but django is not taking csv file path
body: <p>I am creating spam detection system in django in my application from homepage i will enter any string and that string will go to ml function and that function return either string is spam or ham and that result will print on next page but i am not able to define pata of csv file in pd.read_csv function. it is showing error '../data/spam.csv' does not exist: b'../data/spam.csv'</p>
  
  <p>view.py file</p>
  
  <pre><code>def hompage(request):
      form = DetectForm(request.POST)
      return render(request, 'index.html', {'form': form})
  
  
  def result(request): 
      form=DetectForm(request.POST)
      if form.is_valid():
          x=form.cleaned_data['msg']
          y=machine(x)
      return render(request, 'result.html',{'msg':y})
  </code></pre>
  
  <p>ml.py file</p>
  
  <pre><code>    def machine(stringx):
          import pandas as pd
          import numpy as np
          import re
          from nltk.stem.porter import PorterStemmer
          from nltk.corpus import stopwords
  
          data = pd.read_csv('../data/spam.csv', encoding='latin-1')
          data = data.iloc[:, [0, 1]]
          data['v1'] = data.v1.map({'ham': 0, 'spam': 1})
  
          courpas = []
          # data_cleaning
          string = stringx
          df2 = pd.DataFrame({"v1": [0],
                              "v2": [string]})
          data = data.append(df2, ignore_index=True)
  
          # data_cleaning
          for a in data['v2']:
              review = re.sub('[^a-zA-Z]', ' ', a)
              review = review.lower()
              review = review.split()
              ps = PorterStemmer()
              review = [ps.stem(x) for x in review if not x in stopwords.words('english')]
              review = ' '.join(review)
              courpas.append(review)
  
          # create a bag of word model
          from sklearn.feature_extraction.text import CountVectorizer
  
          cv = CountVectorizer(max_features=5000)
          x = cv.fit_transform(courpas).toarray()
          y = data.iloc[:, 0].values
          x_train, ytrain = x[:-1], y[:-1]
          x_test, y_test = x[5572:5573], y[5572:5573]
          from sklearn.model_selection import train_test_split
          from sklearn.naive_bayes import GaussianNB
  
          classifier = GaussianNB()
          classifier.fit(x_train, ytrain)
          y_pred = classifier.predict(x_test)
  
          if y_pred == 1:
              return 'spam'
  
          else:
              return 'ham'
  </code></pre>
  
  <p>result.html file</p>
  
  <pre><code>{% block title %}
      &lt;h2&gt;Result&lt;/h2&gt;
      {% endblock %}
  
      {% block content %}
      &lt;p&gt;{{msg}}&lt;/p&gt;
          {% endblock %}
  </code></pre>
  
  <p>url.py file</p>
  
  <pre><code>    from django.conf.urls import url
      from . import  views
      from django.urls import path
  
      app_name = "spam"
      urlpatterns=[
      url(r'^',views.hompage,name='hompage'),
  
      ]
  </code></pre>