I have a list of tickers, but when I use https://www.bloomberg.com/markets/symbolsearch to find the company name, it shows that tickers are incorrect.
This is the code:
def check_ticker(soup, ticker_c):
tables = soup.findAll("table", {"class": "dual_border_data_table"})
company_name = ""
if len(tables) > 0:
bm_table = tables[0]
rows = bm_table.findAll("tr")
row = rows[1]
cells = row.findAll("td")
if cells[0].get_text() == ticker_c:
cn = cells[1].get_text()
company_name = cn
else:
company_name = ""
else:
b = soup.findAll("div", {"class": "ticker_nomatches"})
if len(b) > 0:
company_name = ""
return company_name
This is the list for which it is not getting any matches:
ESS PW
KKD US
QVCA US
HAR US
LXK US
WWAV US
HEN3 GR
036220 KS
CIG PW
068420 KS
6767 JP
OVTI US
SCTY US
CSC US
STRZA US
ISG LN
Are there any APIs to do this?
Just figured out this bloomberg API:
One can use =BDP("ticker","field") to download the company names.
For example, ESS PW Equity
And the field for company name is "NAME"
This gives :=BDP("ESS PW Equity","Name") company name.
Related
I have the following example:
using DifferentialEquations
function test1(du,u,p,t)
a,b,c = p
d=a^0.1*(t+1)
e=u[1]/a
f=u[2]/d
du[1] = a*u[1]
du[2] = d*u[2]
du[3] = b*u[2] - c*u[3]
end
p = (2,0.75,0.8)
u0 = [1.0;1.0;1.0]
tspan = (0.0,3.0)
prob = ODEProblem(test1,u0,tspan,p)
sol = solve(prob,saveat=0.3)
The sol objects contain state outputs but, I need efficiently other variables ("d","e","f") as well.
The closest I can get is:
function test2(du,u,p,t)
global i
global Out_values
global sampletimes
a,b,c = p
d=a^0.1*(t+1)
e=u[1]/a
f=u[2]/d
if t in sampletimes
Out_values[1,i] = d
Out_values[2,i] = e
Out_values[3,i] = f
i=i+1
end
du[1] = a*u[1]
du[2] = d*u[2]
du[3] = b*u[2] - c*u[3]
end
sampletimes = tspan[1]:0.3:tspan[2]
Out_values = Array{Float64}(undef, 3, 2*11)
i=1
prob = ODEProblem(test2,u0,tspan,p)
sol = solve(prob,saveat=0.3,tstops=sampletimes)
However, this solution is not ideal because:
it duplicates saveat and I get two sets of slightly different outputs (not sure why), and
it can't expand if I decide not to use saveat and I want to output all solutions, i.e. sol = solve(prob).
Any help is appreciated.
I am trying to create vCards (Email contacts) unsing the vobject library and pandas for python.
When serializing the values I get new lines in the "notes" of my output(no new lines in source). In every new line, created by ".serialize()", there is also a space in the beginning. I would need to get rid of both.
Example of output:
BEGIN:VCARD
VERSION:3.0
EMAIL;TYPE=INTERNET:test#example.at
FN:Valentina test
N:Valentina;test;;;
NOTE:PelletiererIn Mitglieder 2 Preiserhebung Aussendung 2 Pressespiegelver
sand 2 GeschäftsführerIn PPA_PelletiererInnen GeschäftsführerIn_Pellet
iererIn
ORG:Test Company
TEL;TYPE=CELL:
TEL;TYPE=CELL:
TEL;TYPE=CELL:
END:VCARD
Is there a way that I can force the output in a single line?
output = ""
for _,row in df.iterrows():
j = vobject.vCard()
j.add('n')
j.n.value = vobject.vcard.Name(row["First Name"],row["Last Name"])
j.add('fn')
j.fn.value = (str(row["First Name"]) + " " + row["Last Name"])
o = j.add("email")
o.value = str((row["E-mail Address"]))
o.type_param = "INTERNET"
#o = j.add("email")
#o.value = str((row["E-mail 2 Address"]))
#o.type_param = "INTERNET"
j.add('org')
j.org.value = [row["Organization"]]
k = j.add("tel")
k.value = str(row["Home Phone"])
k.type_param = "CELL"
k = j.add("tel")
k.value = str(row["Business Phone"])
k.type_param = "CELL"
k = j.add("tel")
k.value = str(row["Mobile Phone"])
k.type_param = "CELL"
j.add("note")
j.note.value = row["Notiz für Kontaktexport"]
output += j.serialize()
print(output)
I can access a MySQL database and store output to an R dataframe using the following script where sam_pn = walker
con <- dbConnect(MySQL(),
user = user,
password = password,
host = host,
dbname = dbname)
df = dbGetQuery(con, "SELECT *
FROM sam AS s
JOIN che AS c ON c.che_label = s.sam_label1
WHERE sam_pn = 'walker'")
But what i would like to do is store 'walker' as an R value pn and then use pn value in the sql query like below so i can vary the pn value.... but it does not work. The syntax is not right. Note sam and che are tables in the database
pn = 'walker'
df = dbGetQuery(con, "SELECT *
FROM sam AS s
JOIN che AS c ON c.che_label = s.sam_label1
WHERE sam_pn = 'pn'")
pn = 'walker'
df = dbGetQuery(con, "SELECT *
FROM sam AS s
JOIN che AS c ON c.che_label = s.sam_label1
WHERE sam_pn = ?",
params = list(pn))
This is what worked in the end
pn = 'walker'
data = dbGetQuery(con, paste0("SELECT *
FROM sam AS s
JOIN che AS c ON c.che_label = s.sam_label1
WHERE sam_pn = '", pn ,"'"))
I am using the Odoo 12 Community version. When I navigate to an employee an error shows ValueError: Field 'ifsc' does not exist and can't open the employee menu. I have inherited employee and it exists in both view and model.
class HrEmployeeInherit(models.Model):
_inherit = 'hr.employee'
sno = fields.Integer(string='Serial No.')
pay = fields.Integer(string='Paycode')
employee_name = fields.Char(string='Emp Name')
designation = fields.Char(string="Designation")
account = fields.Char(string="Account")
bank = fields.Char(string="Bank")
doj = fields.Date(string="Date Of Joining")
ifsc = fields.Char(string="IFSC Code")
present = fields.Float(string="Present Day")
m = fields.Char(string="M-L")
wd = fields.Float(string="WD")
sat = fields.Integer(string="Saturday/Holiday")
week = fields.Integer(string="WeekOff")
leave = fields.Float(string="Leave Adjustment")
payable = fields.Float(string="Total Payable Days")
ot = fields.Float(string="Tdays-OT")
days = fields.Integer(string="T.Days")
wages = fields.Integer(string="Basic wages")
curre = fields.Float(string="Current sal")
sal = fields.Integer(string="% of Salary")
covid = fields.Float(string="Covid 19 salary")
pf = fields.Float(string="PF")
esi = fields.Float(string="Esi")
pay = fields.Integer(string="Payable")
adv = fields.Integer(string="Advance")
tds = fields.Integer(string="Tds")
netpay = fields.Float(string="Net Payable")
icici = fields.Float(string="ICICI")
I have added 'depends': ['base','hr_contract','hr','hr_payroll'] in depends.
I make sales and procurement system and when I work a query, or search the invoice number, the results appear in palm leaves View, but appears only in a row while the bill by no more than one row
And this was used by code
i.m used vb.net and database sql and b yway linq to sql
Try
Dim data = (From d In DBVariable.Data.masterfatoras
From f In DBVariable.Data.fatoras
From na In DBVariable.Data.asnafs
From sup In DBVariable.Data.suppliers
Where d.ID = f.mid Where d.num.Contains(txt)
Select d, f, na, sup).FirstOrDefault
TextBoxX1.Text = data.d.num
nammord.Text = (From supp In DBVariable.Data.suppliers Where data.d.idmord = supp.ID Select supp.Name).Single()
txtmord.Text = (From supp In DBVariable.Data.suppliers Where data.d.idmord = supp.ID Select supp.Code).Single()
adrmord.Text = (From supp In DBVariable.Data.suppliers Where data.d.idmord = supp.ID Select supp.Address).Single()
nodaf.Text = data.d.nodfa
' ''نفاصيل الفاتورة
For p As Integer = 0 To gridshraa.Rows.Count - 1
gridshraa.Rows(p).Cells(2).Value = (From asna In DBVariable.Data.asnafs Where data.f.idname = asna.ID Select asna.Name).Single()
gridshraa.Rows(p).Cells(1).Value = (From asna In DBVariable.Data.asnafs Where data.f.idname = asna.ID Select asna.code).Single()
gridshraa.Rows(p).Cells(3).Value = (From asna In DBVariable.Data.asnafs Where data.f.idname = asna.ID Select asna.unit).Single()
gridshraa.Rows(p).Cells(4).Value = data.f.qty
gridshraa.Rows(p).Cells(5).Value = data.f.price
gridshraa.Rows(p).Cells(6).Value = data.f.totprice
Next
Catch
End Try