Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In[2]: df1.std()
- Out[2]:
- some_int 15281.99
- some_float 5.302293
- In[3]: df2.std()
- Out[3]:
- some_int 15281.99
- some_float 6.691013
- import pandas as pd
- import numpy as np
- data_list = list()
- csv_files = ['a.csv', 'b.csv', 'c.csv']
- for csv_file in csv_files:
- # load csv_file
- tmp_df = pd.read_csv(str(tmp_file), index_col='ID', dtype=np.float64)
- # replace infs by na
- tmp_df.replace([np.inf, -np.inf], np.nan, inplace=True)
- # manipulate tmp_df
- tmp_df = tmp_df*2
- data_list.append(tmp_df)
- df = pd.concat(data_list, ignore_index=True)
- df.reset_index(inplace=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement