Nov-16-2020, 03:43 PM
(Nov-16-2020, 10:10 AM)robboc91 Wrote: hi Python community
I had gone through several Python tutorials before I sat down today to writing my first code
can you judge it, please? I use Colaboratory; how to allow it to access the excel files?
#preliminary steps import numpy as np import pandas as pd import matplotlib as plt import statsmodels as sm data = pd.read_csv("portfolios.csv") bm = pd.read_csv("bookToMarket.csv") me = pd.read_csv("marketEquity.csv") #Extract 99 assets and assign them to a variable called assets. for column in data: print(column [1:99]) #Obtain the number of rows and columns of assets and store results as rr and cc #respectively. rr = sheet.max_row cc = sheet.max_column #For each month in the data, sort the returns on the 99 assets based on the book-to- market ratio of those assets for column[1:99] in bm: assets_sorted = sorted() for column[1:99] in me: me_sorted = sorted() # placing the first 3 rows into a docstring for row[:3] in assets_sorted: docstring() for row[:3] in me_sorted: docstring()
i can't figure out the answer based on what you wrote
i change the code
data = pd.read_csv('C:/Users/YOU/Desktop/python/bbing1234-attachments/portfolios.csv')but i dont know why it fails to read it