Skip to content
Advertisement

Append Data to DataFrame

I did a code in which I pick P-wave seismic waveform, basically is a time pick along waveform, also compute the signal-to-noise and other variables.

Here is part of my code.

JavaScript

But I am not being able to append the output from the function I specify here

scnl, picks, polarity, snr, uncert = picker.picks(tr_cut)

However if I print the output of the function I get the results

print (scnl, picks[i], polarity, snr, uncert) gives an output like this:

JavaScript

The aim of my idea is to append all this output inside the DataFrame but I can not do it. Moreover while I try to convert my DataFrame to CSV I get the following error.

‘list’ object has no attribute ‘to_csv’

Would you mind give me feedback what I am doing wrong, thank you Tonino

Advertisement

Answer

In order to make it work I modified a little the code with @Deep suggestions.

JavaScript

Moving the variable all_ = [] outside of the first loop solved my issue

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement