PooledOLS in python - python-3.x

I have been trying to use panelOLS regression but I kept on getting errors, I have attached the lines of code and the error.
'mod=PanelOLS(data.FDI,data[['Trade openness','GDP growth']],time_effects=True)'
' res = mod.fit(cov_type='clustered', cluster_entity=True)`
error messages

Related

np.isnan() function not solving "divide by zero encountered in true_divide" warning

Pdict = {"KobeBryant":0,"JoeJohnson":1,"LeBronJames":2,"CarmeloAnthony":3,"DwightHoward":4,"ChrisBosh":5,"ChrisPaul":6,"KevinDurant":7,"DerrickRose":8,"DwayneWade":9}
Salary = np.array([KobeBryant_Salary, JoeJohnson_Salary, LeBronJames_Salary, CarmeloAnthony_Salary, DwightHoward_Salary, ChrisBosh_Salary, ChrisPaul_Salary, KevinDurant_Salary, DerrickRose_Salary, DwayneWade_Salary])
Games = np.array([KobeBryant_G, JoeJohnson_G, LeBronJames_G, CarmeloAnthony_G, DwightHoward_G, ChrisBosh_G, ChrisPaul_G, KevinDurant_G, DerrickRose_G, DwayneWade_G])
plr =[]
for v in Pdict.values():
for s in Salary:
for g in Games:
if np.isnan(g[v]) == True: continue
z = np.round(np.divide(s[v], Games[v]), 2)
plr.append(z)
print(plr)
print(type(z))
Im trying to make a new matrix called plr, there is a zero in Games[] and Im trying to make it skip it instead of giving me that error. I found the np.isnan() but it seems to do nothing here. If I run the code with or without that line, it still gives me the runtime warning. Im not sure what Im doing wrong with it or is there a better way to do this?

bioMart Package error: error in function useDataset

I am trying to use the biomaRt package to access the data from Ensembl, however I got error message when using the useDataset() function. My codes are shown below.
library(httr)
listMarts()
ensembl = useMart("ENSEMBL_MART_ENSEMBL")
listDatasets(ensemble)
ensembl = useDataset("hsapiens_gene_ensembl",mart = ensemble)
When I type useDataset function i got error message like this:
> ensembl = useDataset("hsapiens_gene_ensembl",mart = ensembl)
Ensembl site unresponsive, trying asia mirror
Error in textConnection(text, encoding = "UTF-8") :
invalid 'text' argument
and sometimes another different error message showed as:
> ensembl = useDataset("hsapiens_gene_ensembl",mart = ensembl)
Ensembl site unresponsive, trying asia mirror
Error in textConnection(bmResult) : invalid 'text' argument
it seems like that the mirror automatically change to asia OR useast OR uswest, but the error message still shows up over and over again, and i don't know what to do.
So if anyone could help me with this? I will be very grateful for any help or suggestion.
Kind regards Riley Qiu, Dongguan, China

Pickle in python3, error on concating string to bytes

I am converting some code from python2 to 3 and saw an error that the 2to3 did not catch on a line:
pickle.dumps(('predskew', predskewData[0])) + pickleSep
That produces an error in python3:
pickledPredskewData = pickle.dumps(('predskew', predskewData[0])) + pickleSep
TypeError: can't concat str to bytes
I know from other posts on stack over flow I could perhaps use an encode? or a decode? I just wasn't sure where or what. So I did try this in python2:
pickleSep = ":::::"
pickle.dumps(('predskew',0)) + pickleSep
Which produces:
"(S'predskew'\np0\nI0\ntp1\n.:::::"
Also,
pickle.dumps(('predskew',0)) + pickleSep.encode()
Gives the same result.
Now if I try the same line in python3, I get what 'looks' like vastly different output:
pickle.dumps(('predskew', 0)) + pickleSep.encode()
Gives the output of:
b'\x80\x04\x95\x10\x00\x00\x00\x00\x00\x00\x00\x8c\x08predskew\x94K\x00\x86\x94.:::::'
So not sure my encode fix is the right approach as the answers seem different (unless it is the print just showing me the bytes itself?!)

AwesomeWM: Error when initialising a theme

I've currently started using the AwesomeWM and started configuring it. I struggle at theming: whenever I try to change the theme, I get this error message:
https://i.stack.imgur.com/vAbuW.png
It tells me that the error is on the line 553/554, but if I don't adjust any themes, they work without any errors.
Code for theming:
local theme_path = string.format("%s/.config/awesome/themes/%s/theme.lua", os.getenv("HOME"), "powerarrow")
beautiful.init(theme_path)
Lines the error says are wrong (553/554):
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
So, what's the problem?

Syntax error when trying to input errors for a set of data

I'm trying to create a graph using Jupyter Notebooks but when I input errors for a data set "syntax error" appears referring to the word error, any ideas on the problem?
measured_time2 = q.MeasurementArray(
data = [0,0.2,1.0,2.2,4.0,6.2,9.0,12.2,16.0,20.2,25]
error = [0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1])
File "<ipython-input-36-96c22be70112>", line 8
error = [0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1])
^
SyntaxError: invalid syntax

Resources