Python Forum
my first code, please correct
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
my first code, please correct
#1
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()
Reply


Messages In This Thread
my first code, please correct - by robboc91 - Nov-16-2020, 10:10 AM
RE: my first code, please correct - by jefsummers - Nov-16-2020, 01:01 PM
RE: my first code, please correct - by robboc91 - Nov-16-2020, 02:34 PM
RE: my first code, please correct - by robboc91 - Nov-16-2020, 03:43 PM
RE: my first code, please correct - by DougBTX - Nov-16-2020, 06:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Correct the algorithm of image filter code saoko 6 2,158 May-08-2022, 05:06 PM
Last Post: saoko
  Getting the error like function not defined .. suggest correct code raghava 1 2,133 Feb-04-2020, 11:20 PM
Last Post: micseydel
  The code seems correct but my files aren't getting deleted taffylim69 1 2,199 Feb-03-2019, 11:00 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020