title: Facing a problem regarding LDA interfacing in python
body: <p>I want to classify data with run time values in LDA algorithm in Python. Below is the code i tried but model.fit(X, y) gives error:</p>
  <pre><code>ValueError: Input contains NaN, infinity or a value too large for dtype('float64').
  </code></pre>
  <p>Code:</p>
  <pre><code>from sklearn.model_selection import train_test_split
  from sklearn.model_selection import RepeatedStratifiedKFold
  from sklearn.model_selection import cross_val_score
  from sklearn.discriminant_analysis import LinearDiscriminantAnalysis 
  from sklearn import datasets
  import matplotlib.pyplot as plt
  import pandas as pd
  import numpy as np
  
  df = pd.read_excel (r'C:\Users\Adil Arshad\Desktop\dataacquistion py\adc.xlsx')
  #print (df)
  last_column = df.iloc[: , -1:]
  print(&quot;Last Column Of Dataframe : &quot;)
  print(last_column)
  new_last = str(last_column)
  print(type(new_last))
  
  df.columns = ['TL', 'CL', 'TR', 'CR', 'new_last']
  #view first six rows of DataFrame
  df.head()
  print(df)
  
  X = df[['TL', 'CL', 'TR', 'CR', 'new_last']]
  y = df['new_last']
  
  #Fit the LDA model
  model = LinearDiscriminantAnalysis()
  model.fit(X, y)
  </code></pre>