Challenge

Project 1

import pandas as pd
import numpy as np

data1= pd.read_csv('Stock_File_1.csv')
data2= pd.read_csv('Stock_file_2.txt')
unique1, counts1 = np.unique(data1['Date'], return_counts=True)
unique2, counts2 = np.unique(data2['Date'], return_counts=True)
data_merged = pd.concat([data1, data2], axis=0, join='inner', ignore_index =True)
data_merged['Volume']=data_merged.Volume.replace("zero",0)
data_merged['Volume']=data_merged.Volume.astype(int)
data_merged.info()
data_merged.describe()
x=data_merged.loc[data_merged['Volume'] == 0]
ind=x.index
for i in range(len(ind)):
    if data_merged['Open'].iloc[ind[i]]!= data_merged['High'].iloc[ind[i]]:
        if data_merged['High'].iloc[ind[i]]==data_merged['Low'].iloc[ind[i]] and data_merged['Low'].iloc[ind[i]]==data_merged['Close'].iloc[ind[i]]:
            data_merged['Open'].iloc[ind[i]]=data_merged['Close'].iloc[ind[i]]
Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.