Category : python

I’m trying to understand how this code works, we have: people = [‘Dr. Christopher Brooks’, ‘Dr. Kevyn Collins-Thompson’, ‘Dr. VG Vinod Vydiswaran’, ‘Dr. Daniel Romero’] def split_title_and_name(person): return person.split()[0] + ‘ ‘ + person.split()[-1] So we are given a list, and this method is supposed to basically delete everything in the middle between "Dr." and ..

Read more

I’m doing a BOT with WhatsApp, it worked fine, the part where it saves the cookie stopped working, I don’t know what I can do to make it work again. I do not know what it could be chromepath = ‘C:chromedriver.exe’ option = webdriver.ChromeOptions() option.add_argument(“user-data-dir=C:UserslfAppDataLocalTempscoped_dir22936_226455774Default”) strong text Source: Python..

Read more

I have the following code: import streamlit as st import pandas as pd #define data d = {‘id’: [‘a’, ‘b’, ‘c’], ‘data’: [3, 4,6]} df = pd.DataFrame(data=d) #create sidebar input with st.sidebar.form("my_form"): a = st.slider(‘sidebar for testing’, 5, 10, 9) calculate = st.form_submit_button(‘Calculate’) if calculate: df[‘result’] = df[‘data’] + a st.write(df) #no issues up to ..

Read more

I have several thousands URIRef ontology values that I’m trying to get a string representation of: [rdflib.term.URIRef(‘http://purl.obolibrary.org/obo/RO_0002219’), rdflib.term.URIRef(‘http://purl.obolibrary.org/obo/RO_0002551’), rdflib.term.URIRef(‘http://purl.obolibrary.org/obo/uberon/core#indirectly_supplies’)] I could go to each one’s link individually (eg http://purl.obolibrary.org/obo/RO_0002219) and get it (e.g surrounded by), but how can I do it with Python? Note that some of them don’t have anything attached to them (eg ..

Read more