I have two dataframes in the same time resolution. From the first dataframe (in my case: df_data1) I only want to have all values ['A'] where ['B'] is < 90. And now I'd like filter my secound dataframe so that I have only the values with the same timestamp(timeindex) from my first dataframe
df_data1 = pd.io.parsers.read_csv(station_path, skiprows=0, index_col=0, na_values=[-999], names= names_header , sep=';', header=None , squeeze=True)
date A B
16.08.2013 03:00 -1 97
16.08.2013 03:15 -1 95
16.08.2013 03:30 0 92
16.08.2013 03:45 4 90
16.08.2013 04:00 18 88
16.08.2013 04:15 42 86
16.08.2013 04:30 73 83
16.08.2013 04:45 110 81
16.08.2013 05:00 151 78
Now I'd like to have all df_data['A'] where df_data['B'] is <90. So I do:
df_data = df_data[(df_data['B'] < 90)]
the second dataframe looks like:
df_data2 = pd.io.parsers.read_csv(station_path, skiprows=1, sep=";", index_col=False, header=None)
date w x y z
16.08.2013 03:00 0 0 0 0
16.08.2013 03:15 0 0 0 0
16.08.2013 03:30 0 0 0 0
16.08.2013 03:45 0 0 0 0
16.08.2013 04:00 0 0 0 0
16.08.2013 04:15 0 0 0 0
16.08.2013 04:30 47 47 48 0
16.08.2013 04:45 77 78 79 88
16.08.2013 05:00 111 112 113 125
Have anyone an idea to solve this?
I need the dataframes in the same shape cause furthermore I'd like to calculate the np.corrcoef and so on.