jeudi 14 juillet 2016

Retriving all the rows from a csv file and plotting


I need to retrieve the rows from a csv file generated from the function:

def your_func(row):
    return (row['x-momentum']**2+ row['y-momentum']**2 + row['z-momentum']**2)**0.5 / row['mass']

columns_to_keep = ['#time', 'x-momentum', 'y-momentum', 'z-momentum', 'mass']
dataframe = pd.read_csv("./flash.csv", usecols=columns_to_keep)
dataframe['mean_velocity'] = dataframe.apply(your_func, axis=1)

print dataframe

I got rows up until 29s then it skipped to the last few lines, also I need to plot this column 2 against 1


Aucun commentaire:

Enregistrer un commentaire