SyntaxError: non-keyword arg after keyword arg, with no apparent reason
<p>I have a .dat file which I first want to convert into a .csv file and then plot some of the rows against time, my scripts is as follows :</p>

<pre><code>import pandas as pd
import numpy as np
from sys import argv
from pylab import *


import csv



script, filename = argv

txt = open(filename)

print "Here's your file %r:" % filename
print txt.read()

# read flash.dat to a list of lists
datContent = [i.strip().split() for i in open("./flash.dat").readlines()]

# write it as a new CSV file
with open("./flash.csv", "wb") as f:
    writer = csv.writer(f)
    writer.writerows(datContent)



def your_func(row):
    return (row['global_beta'])


columns_to_keep = ['#time', 'global_beta', 'max_dens', 'max_temp', 'dens@max_temp']
dataframe = pd.read_csv("./flash.csv", usecols=columns_to_keep)



dataframe['Nuclear_Burning'] = dataframe.apply(your_func, axis=1)



pd.set_option('display.height', 1000)
pd.set_option('display.max_rows', 1000)
pd.set_option('display.max_columns', 500)
pd.set_option('display.width', 1000)

dataframe.plot(x='#time', 'Nuclear_Burning', style='r')

print dataframe

show()
</code></pre>

<p>I executed the script with <code>python csv_flash_dat_file.py flash.dat</code> and got the following error :</p>

<pre><code>File "csv_flash_dat_file.py", line 46
    dataframe.plot(x='#time', 'Nuclear_Burning', style='r')
SyntaxError: non-keyword arg after keyword arg
</code></pre>

<p>I don't see the apparent reason to find the error, please help me fix this.</p>

<p>It's just what it says. You can't pass non-keyword arguments after keyword arguments. If you have something like x='#time', that's a keyword argument, and all of those have to come at the end of the argument list.</p>

python csv pandas