import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import sys, os
import datetime
from matplotlib.pylab import rcParams
%matplotlib inline
import warnings
import seaborn as sns
import functools
!ls *.csv > lista.txt
lista = pd.read_csv('lista.txt', header = None)
list_of_rows = [j for j in lista.values]
# Print list of lists i.e. rows
len(list_of_rows)
filesnames = os.listdir()
filesnames = [f for f in filesnames if (f.endswith(".csv"))]
dfs = list()
string = "_df"
for filename in filesnames:
#print(filename)
#nueva = string.join(filename)
df = pd.read_csv(filename)
dfs.append(df)
merged = pd.merge(dfs[0], dfs[1])
#for i in range(len(dfs)):
for i in range(len(dfs)):
merged = pd.merge(merged, dfs[i])
merged
merged = pd.merge(dfs[0], dfs[1])
merged = pd.merge(merged, dfs[9])
merged
from sklearn import preprocessing
df_num = merged.select_dtypes(include=[np.number])
x = df_num.values #returns a numpy array
min_max_scaler = preprocessing.MinMaxScaler()
x_scaled = min_max_scaler.fit_transform(x)
df_num = pd.DataFrame(x_scaled)
df_num
result = pd.concat([merged.select_dtypes(np.object), df_num], axis=1)
result
result.to_csv("metztitlan2_merged.csv",index=False, header=False)
os.chdir("fisher-nodo/")
fs = !ls *.png
import IPython.display as dp
# create list of image objects
images = []
for ea in fs:
images.append(dp.Image(filename=ea, format='png'))
# display all images
for ea in images:
dp.display_png(ea)