I am trying to make a program that is able to convert a varying length csv to a dataframe. I am then trying to graph specific columns of the dataframe, with the x values being the index divided by 1000 (the sample rate was 1000Hz). 

However, I am having a weird interaction where it's graphing the values of the columns but in a linear-ish fashion and just labeling the point as a value. It's possibly graphing the index values, but I'm not sure because the output is a curve. 
The current dataset I am working with is over 5000 datapoints for about 12 devices (all sampled at the same time). I will show a snippet of the data below.

Here is the output below:
[![enter image description here](https://i.stack.imgur.com/H0jZM.png)](https://i.stack.imgur.com/H0jZM.png)
The right graph is the fft of the left graph's values.

This is what the output is supposed to look like:
[![enter image description here](https://i.stack.imgur.com/xlgk0.png)](https://i.stack.imgur.com/xlgk0.png)
The right graph is the same for both, which is the correct output. This tells me that something weird is going on for my plot of the left graph, but the whole code isn't wrong.

Here is my code:

```
from scipy import fftpack
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
import csv
temp = []
samplerate = 1000

with open('C:/Users/sword/Anaconda3/envs/exceltest/RF_SubjP02_Free_STATIC_TR02.csv', 'r') as csvfile:
  csvreader = csv.reader(csvfile, delimiter=',')
  for row in csvreader:
     if csvreader.line_num == 3:
         temp.append(row)
     if csvreader.line_num >= 6:
        if row:
            temp.append(row)
        else:
            break
df = pd.DataFrame(temp) #turns the array into a dataframe
df.columns = df.iloc[0] #sets the column names as the first row
df = df.drop(0) #drops the first row since it is now a duplicate of the column names 
emg1 = df['Noraxon Desk Receiver - EMG1']
horiz = np.arange(0,len(emg1)/samplerate,1/samplerate) #getting the time domain in seconds

emgfft = fftpack.fft(emg1, horiz.size)  #fft of the emg
emgfftabs = np.abs(emgfft) #absolute value of the fft values
xf = fftpack.fftfreq(horiz.size, (len(emg1) / samplerate) / samplerate) #frequency range

plt.figure()
plt.subplot(1,2,1)
plt.plot(horiz, emg1) #tried this one and the one below with the same result, both gave the wrong curved graph from the first picture
plt.plot(df['Noraxon Desk Receiver - EMG1']) #I didn't use both at the same time
ticks = plt.yticks(df['Noraxon Desk Receiver - EMG1'].values[::100]) #this is just here to make it readable, otherwise the y labels are a solid black bar

plt.subplot(1,2,2)
plt.plot(xf[0:len(xf)//2],2*emgfftabs[0:len(emgfftabs)//2])
plt.show()

```

Note that 'Noraxon Desk Receiver - EMG1' was the original column name before I renamed it to 'emg1' in the csv file.

A sample of the dataset is below

[![enter image description here](https://i.stack.imgur.com/ujNBA.png)](https://i.stack.imgur.com/ujNBA.png)

The value of emg1, which is possibly helpful to know, is

[![enter image description here](https://i.stack.imgur.com/otNgf.png)](https://i.stack.imgur.com/otNgf.png)

The index doesn't seem to be separable from the values from what I can tell. The dtype of emg1 ends up being 'object'. I've tried to use '.tolist()',but that didn't work either.

Any help solving this would be appreciated!