MobileFirst Foundation 8 on Bluemix Java Buildpacks: "No space left on device" - ibm-mobilefirst

I deployed MobileFirst Foundation version 8.0.0.00-20160809-2334 on Bluemix Java buildpacks via scripts.
Starting last week, the configuration for adapters has disappeared, the mobile apps do not work anymore and any configuration action I try to perform results in one of the following errors:
mfp///10.254.0.6 FAILURE FWLSE0321: State change failure. Caused by: java.io.IOException: No space left on device
Or:
FAILURE java.io.IOException: No space left on device
dashDB reports only 4% memory used and we only used 375MB out of 1GB disk space, so it's unclear what could be going wrong.
Updated as requested in comments, Below a stack trace of the error when trying to upload an adapter:
APP/0[INFO ] Adapter initialized!Jan 24, 2017 9:35:06 AM
APP/0[ERROR ] RuntimeMBeanCallable.call() exceptionJan 24, 2017 9:35:09 AM
APP/0java.io.IOException: No space left on deviceJan 24, 2017 9:35:09 AM
APP/0[err] java.lang.RuntimeException: java.io.IOException: No space left on deviceJan 24, 2017 9:35:09 AM
APP/0[err] at com.ibm.mfp.server.app.internal.webresources.ApplicationWebResourceDescriptorHandler.deploy(ApplicationWebResourceDescriptorHandler.java:34)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.ibm.mfp.server.app.internal.webresources.ApplicationWebResourceDescriptorHandler.sign(ApplicationWebResourceDescriptorHandler.java:99)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.ibm.mfp.server.app.internal.webresources.ApplicationWebResourceDescriptorHandler.deploy(ApplicationWebResourceDescriptorHandler.java:64)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.ibm.mfp.server.core.internal.deployment.DeploymentManagerImpl.changeDeploymentState(DeploymentManagerImpl.java:380)Jan 24, 2017 9:35:09 AM
APP/0[err] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.ibm.mfp.server.core.internal.deployment.DeploymentManagerImpl.redeployIfNeeded(DeploymentManagerImpl.java:434)Jan 24, 2017 9:35:09 AM
APP/0[err] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.ibm.mfp.server.mgmt.internal.connectivity.RuntimeMXBeanImpl.changeDeploymentState(RuntimeMXBeanImpl.java:93)Jan 24, 2017 9:35:09 AM
APP/0[err] at java.lang.reflect.Method.invoke(Unknown Source)Jan 24, 2017 9:35:09 AM
APP/0[err] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)Jan 24, 2017 9:35:09 AM
APP/0[err] at sun.reflect.misc.Trampoline.invoke(Unknown Source)Jan 24, 2017 9:35:09 AM
APP/0[err] at java.lang.reflect.Method.invoke(Unknown Source)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(Unknown Source)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(Unknown Source)Jan 24, 2017 9:35:09 AM
APP/0[err] at sun.reflect.misc.MethodUtil.invoke(Unknown Source)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(Unknown Source)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(Unknown Source)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(Unknown Source)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(Unknown Source)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.sun.jmx.mbeanserver.MBeanSupport.invoke(Unknown Source)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(Unknown Source)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.sun.jmx.mbeanserver.MXBeanProxy$InvokeHandler.invoke(Unknown Source)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.ibm.ws.kernel.boot.jmx.internal.PlatformMBeanServer.invoke(PlatformMBeanServer.java:373)Jan 24, 2017 9:35:09 AM
APP/0[err] at javax.management.MBeanServerInvocationHandler.invoke(Unknown Source)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.ibm.mfp.admin.actions.ArtifactDeploymentTransaction.prepareMBean(ArtifactDeploymentTransaction.java:822)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.ibm.ws.kernel.boot.jmx.service.MBeanServerForwarderDelegate.invoke(MBeanServerForwarderDelegate.java:197)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.sun.jmx.mbeanserver.MXBeanProxy.invoke(Unknown Source)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.sun.proxy.$Proxy361.changeDeploymentState(Unknown Source)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.ibm.mfp.admin.actions.util.RuntimeMBeanWorkerThreadCaller.callSynchronously(RuntimeMBeanWorkerThreadCaller.java:206)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.ibm.mfp.admin.actions.BaseTransaction.prepare(BaseTransaction.java:561)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.ibm.mfp.admin.actions.util.RuntimeMBeanWorkerThreadCaller$RuntimeMBeanCallable.call(RuntimeMBeanWorkerThreadCaller.java:76)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.ibm.mfp.admin.actions.util.RuntimeMBeanPoolCaller.callRuntimeMBeans(RuntimeMBeanPoolCaller.java:91)Jan 24, 2017 9:35:09 AM
APP/0[err] at java.lang.reflect.Method.invoke(Unknown Source)Jan 24, 2017 9:35:09 AM
APP/0[err] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.internal.handlers.CreateInvocationParametersHandler.handleRequest(CreateInvocationParametersHandler.java:54)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.internal.handlers.InvokeMethodHandler.handleRequest(InvokeMethodHandler.java:63)Jan 24, 2017 9:35:09 AM
APP/0[err] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.ibm.mfp.admin.actions.BaseTransaction.run(BaseTransaction.java:327)Jan 24, 2017 9:35:09 AM
APP/0[err] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.ibm.mfp.admin.services.v2.AdapterService.addAdapter(AdapterService.java:351)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.ibm.mfp.admin.actions.BaseTransaction.internalRun(BaseTransaction.java:454)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.AbstractHandler.handleRequest(AbstractHandler.java:33)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.AbstractHandler.handleRequest(AbstractHandler.java:34)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleResourceMethod(FindResourceMethodHandler.java:151)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleSubResourceLocator(FindResourceMethodHandler.java:230)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleSubResourceLocator(FindResourceMethodHandler.java:230)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleRequest(FindResourceMethodHandler.java:65)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleRequest(FindResourceMethodHandler.java:115)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleRequest(FindResourceMethodHandler.java:115)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleRequest(FindResourceMethodHandler.java:115)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.internal.handlers.FindResourceMethodHandler.handleSubResourceLocator(FindResourceMethodHandler.java:230)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.internal.handlers.HeadMethodHandler.handleRequest(HeadMethodHandler.java:53)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.internal.handlers.OptionsMethodHandler.handleRequest(OptionsMethodHandler.java:46)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.internal.handlers.FindRootResourceHandler.handleRequest(FindRootResourceHandler.java:95)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.internal.handlers.SearchResultHandler.handleRequest(SearchResultHandler.java:33)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.internal.log.ResourceInvocation.handleRequest(ResourceInvocation.java:92)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.handlers.AbstractHandlersChain.run(AbstractHandlersChain.java:52)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.internal.log.Requests.handleRequest(Requests.java:76)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.internal.RequestProcessor.handleRequestWithoutFaultBarrier(RequestProcessor.java:207)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.internal.RequestProcessor.handleRequest(RequestProcessor.java:154)Jan 24, 2017 9:35:09 AM
APP/0[err] at org.apache.wink.server.internal.servlet.RestServlet.service(RestServlet.java:133)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.ibm.mfp.admin.services.RestServlet.service(RestServlet.java:43)Jan 24, 2017 9:35:09 AM
APP/0[err] at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1285)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.ibm.mfp.admin.services.RestFilter.doFilter(RestFilter.java:61)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:207)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.ibm.worklight.admin.common.filter.HSTSFilter.doFilter(HSTSFilter.java:110)Jan 24, 2017 9:35:09 AM
APP/0[err] at [internal classes]Jan 24, 2017 9:35:09 AM
APP/0[err] at [internal classes]Jan 24, 2017 9:35:09 AM
APP/0[err] at [internal classes]Jan 24, 2017 9:35:09 AM
APP/0[err] Caused by: Jan 24, 2017 9:35:09 AM
APP/0[err] at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:207)Jan 24, 2017 9:35:09 AM
APP/0[err] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)Jan 24, 2017 9:35:09 AM
APP/0[err] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)Jan 24, 2017 9:35:09 AM
APP/0[err] java.io.IOException: No space left on deviceJan 24, 2017 9:35:09 AM
APP/0[err] at java.io.FileOutputStream.write(Unknown Source)Jan 24, 2017 9:35:09 AM
APP/0[err] at java.lang.Thread.run(Unknown Source)Jan 24, 2017 9:35:09 AM
APP/0[err] ... 128 moreJan 24, 2017 9:35:09 AM
APP/0[err] at com.ibm.mfp.server.app.internal.webresources.ApplicationWebResourceDescriptorHandler.getBase64EncodedFile(ApplicationWebResourceDescriptorHandler.java:151)Jan 24, 2017 9:35:09 AM
APP/0[err] at java.io.FileOutputStream.writeBytes(Native Method)Jan 24, 2017 9:35:09 AM
APP/0[err] at com.ibm.mfp.server.app.internal.webresources.ApplicationWebResourceDescriptorHandler.sign(ApplicationWebResourceDescriptorHandler.java:91)Jan 24, 2017 9:35:09 AM
APP/0[INFO ] Adapter destroyed!Jan 24, 2017 9:35:09 AM
APP/0[ERROR ] CNFSRVE115: configuration with id 'ADAPTER_CONTENT' for schema 'mfp_default_schema' with version '1.0' not foundJan 24, 2017 9:35:09 AM
APP/0[ERROR ] Unable to delete configuration with id ADAPTER_CONTENT due to exception FWLSE3208E: An invalid status code "404" was returned. The response content is "{"reason":"configuration_not_found","details":"CNFSRVE115: configuration with id 'ADAPTER_CONTENT' for schema 'mfp_default_schema' with version '1.0' not found"}".

There was a defect in the initial versions of the MFP server kit. The issue was that the BLOB size was 1M, so any adapter with 1M would fail to upload. Ideally you should shift to the latest iFix where the issue is fixed. However, if you want to patch the existing DB then follow the procedure
Find the Schema name you are using : For Ex If the Schema name is MFP_447EE21A
Log on to the Dash-DB.
Select the Default schema as Schema name you are using
Go to the Run SQL and execute the below SQL statements:
(Update the below SQL commands with the Schema name.)
ALTER TABLE MFP_447EE21A.CS_ATTACHMENTS DROP COLUMN CONTENT;
ALTER TABLE MFP_447EE21A.CS_ATTACHMENTS ADD COLUMN CONTENT BLOB(1 G);
call ADMIN_CMD('REORG TABLE MFP_447EE21A.CS_ATTACHMENTS’);
Make sure the above SQL statements are run successfully.
Restart the MFP App instance.

Related

SQL group by 7am to 7am

How do I simply group by a 24 hour interval from 7am to 7am in a manner similar to:
select format(t_stamp,'yyyy-MMM')
from mytable
group by format(t_stamp,'yyyy-MMM')
if input is like
3,Wed Mar 23 20:40:40 EDT 2022
3,Wed Mar 23 20:40:39 EDT 2022
4,Wed Mar 23 03:36:10 EDT 2022
3,Wed Mar 22 15:46:44 EST 2022
3,Tue Mar 22 04:16:52 EST 2022
4,Sat Mar 22 03:13:08 EDT 2022
3,Sat Mar 22 03:13:05 EDT 2022
4,Sat Mar 21 04:10:36 EDT 2022
output should be like
6, Mar 23
7, Mar 22
10, Mar 21
4, Mar 20

Creating a dataframe with web scraping

I am trying to scrape a website called WikiCFP and return the information in the table as a dataframe.
As of now I have this code
import requests
from bs4 import BeautifulSoup
import pandas as pd
import re
df = pd.DataFrame(columns=["abbreviation", "name", "dates", "place", "deadline"])
url = "http://www.wikicfp.com/cfp/call?conference=computer%20science&page=1"
response = requests.get(url)
soup= BeautifulSoup(response.content, "html.parser")
table = soup.find("table", align="center",cellpadding="3",cellspacing="1",width="100%")
for row in table.find_all("tr")[1:]:
values= row.find_all("td")
print(values[0].text.split("/n")[0])
I specifically don't know how to convert the text in each row into a viable list or some other thing from which a dataframe can be made.
Thanks in advance
You can use read_html directly:
dfs = pd.read_html(url, header=0) # return all tables in a list of dataframe
df = dfs[4] # 4 is the index of the dataframe you want
Output:
>>> df
Event When Where Deadline Unnamed: 4
0 DSA 2021 2nd International Conference on Data Science a... 2nd International Conference on Data Science a... 2nd International Conference on Data Science a... NaN
1 DSA 2021 Nov 27, 2021 - Nov 28, 2021 Dubai, UAE Oct 24, 2021 NaN
2 NCWMC 2022 7th International Conference on Networks, Comm... 7th International Conference on Networks, Comm... 7th International Conference on Networks, Comm... NaN
3 NCWMC 2022 Jul 30, 2022 - Jul 31, 2022 London, United Kingdom Oct 24, 2021 NaN
4 ICAIT 2022 11th International Conference on Advanced Comp... 11th International Conference on Advanced Comp... 11th International Conference on Advanced Comp... NaN
5 ICAIT 2022 Jul 23, 2022 - Jul 24, 2022 Toronto, Canada Oct 24, 2021 NaN
6 CNDC 2021 8th International Conference on Computer Netwo... 8th International Conference on Computer Netwo... 8th International Conference on Computer Netwo... NaN
7 CNDC 2021 Nov 27, 2021 - Nov 28, 2021 Dubai, UAE Oct 24, 2021 NaN
8 CAIML 2022 3rd International Conference on Artificial Int... 3rd International Conference on Artificial Int... 3rd International Conference on Artificial Int... NaN
9 CAIML 2022 Jul 23, 2022 - Jul 24, 2022 Toronto, Canada Oct 24, 2021 NaN
10 ITCSE 2022 11th International Conference on Information T... 11th International Conference on Information T... 11th International Conference on Information T... NaN
11 ITCSE 2022 Jul 23, 2022 - Jul 24, 2022 Toronto, Canada Oct 24, 2021 NaN
12 CCSIT 2022 12th International Conference on Computer Scie... 12th International Conference on Computer Scie... 12th International Conference on Computer Scie... NaN
13 CCSIT 2022 Jul 30, 2022 - Jul 31, 2022 London, United Kingdom Oct 24, 2021 NaN
14 SOEN 2022 7th International Conference on Software Engin... 7th International Conference on Software Engin... 7th International Conference on Software Engin... NaN
15 SOEN 2022 Jul 30, 2022 - Jul 31, 2022 London, United Kingdom Oct 24, 2021 NaN
16 AIAA 2021 11th International Conference on Artificial In... 11th International Conference on Artificial In... 11th International Conference on Artificial In... NaN
17 AIAA 2021 Nov 27, 2021 - Nov 28, 2021 Dubai, UAE Oct 24, 2021 NaN
18 NLPTA 2021 2nd International Conference on NLP Techniques... 2nd International Conference on NLP Techniques... 2nd International Conference on NLP Techniques... NaN
19 NLPTA 2021 Nov 27, 2021 - Nov 28, 2021 Dubai, UAE Oct 24, 2021 NaN
20 CSTY 2021 7th International Conference on Computer Scien... 7th International Conference on Computer Scien... 7th International Conference on Computer Scien... NaN
21 CSTY 2021 Dec 18, 2021 - Dec 19, 2021 Dubai, UAE Oct 24, 2021 NaN
22 KG#SAC 2022 ACM SAC 2022 Track on Knowledge Graphs ACM SAC 2022 Track on Knowledge Graphs ACM SAC 2022 Track on Knowledge Graphs NaN
23 KG#SAC 2022 Apr 25, 2022 - Apr 29, 2022 Brno, Czech Republic Oct 24, 2021 NaN
24 E&C 2021 5th International Conference on Electrical & C... 5th International Conference on Electrical & C... 5th International Conference on Electrical & C... NaN
25 E&C 2021 Nov 27, 2021 - Nov 28, 2021 Dubai, UAE Oct 24, 2021 NaN
26 IoTE 2021 2nd International Conference on Internet of Th... 2nd International Conference on Internet of Th... 2nd International Conference on Internet of Th... NaN
27 IoTE 2021 Nov 27, 2021 - Nov 28, 2021 Dubai, UAE Oct 24, 2021 NaN
28 EEEN 2021 5th International Conference on Electrical and... 5th International Conference on Electrical and... 5th International Conference on Electrical and... NaN
29 EEEN 2021 Nov 27, 2021 - Nov 28, 2021 Dubai, UAE Oct 24, 2021 NaN
30 CVIE--EI, Scopus 2022 2022 2nd International Conference on Computer ... 2022 2nd International Conference on Computer ... 2022 2nd International Conference on Computer ... NaN
31 CVIE--EI, Scopus 2022 Feb 18, 2022 - Feb 20, 2022 Sanya, China Oct 25, 2021 NaN
32 ICCDA--Ei, Scopus 2022 2022 The 6th International Conference on Compu... 2022 The 6th International Conference on Compu... 2022 The 6th International Conference on Compu... NaN
33 ICCDA--Ei, Scopus 2022 Feb 18, 2022 - Feb 20, 2022 Sanya, China Oct 25, 2021 NaN
34 ACM--ICMLC--Ei and Scopus 2022 ACM--2022 14th International Conference on Mac... ACM--2022 14th International Conference on Mac... ACM--2022 14th International Conference on Mac... NaN
35 ACM--ICMLC--Ei and Scopus 2022 Feb 18, 2022 - Feb 20, 2022 Guangzhou, China Oct 25, 2021 NaN
36 IEEE CSP--EI Compendex, Scopus 2022 2022 IEEE 6th International Conference on Cryp... 2022 IEEE 6th International Conference on Cryp... 2022 IEEE 6th International Conference on Cryp... NaN
37 IEEE CSP--EI Compendex, Scopus 2022 Jan 14, 2022 - Jan 16, 2022 Tianjin, China Oct 25, 2021 NaN
38 ACM--ICMIP--Ei and Scopus 2022 ACM--2022 7th International Conference on Mult... ACM--2022 7th International Conference on Mult... ACM--2022 7th International Conference on Mult... NaN
39 ACM--ICMIP--Ei and Scopus 2022 Jan 14, 2022 - Jan 16, 2022 Tianjin, China Oct 25, 2021 NaN
Try
values.getText()
getText() function returns textual content from bs4 HTML objects.

plot annual data for several locations on the same plot in python [duplicate]

This question already has answers here:
Plotting multiple lines, in different colors, with pandas dataframe
(6 answers)
Closed 1 year ago.
I have a dataframe of 20 years for several stations. I would like to plot it in a way, the x-axis is the year, the y axis is the observations and the colour of lines shows the location.
station year observations
0 3939 2000 0.346518
1 3939 2001 0.278250
2 3939 2002 1.096147
3 3939 2003 0.423948
4 3939 2004 0.000000
5 3939 2005 0.000000
6 3939 2006 0.000000
7 3939 2007 0.663922
8 3939 2008 0.000000
9 3939 2009 0.000000
10 3939 2010 0.000000
11 3939 2011 2.921322
12 3939 2012 1.463399
13 3939 2013 1.402697
14 3939 2014 0.000000
15 3939 2015 0.000000
16 3939 2016 0.000000
17 3939 2017 0.000000
18 3939 2018 0.000000
19 3939 2019 2.599236
20 3939 2020 1.428136
21 3953 2000 5.893202
22 3953 2001 7.227092
23 3953 2002 6.489147
24 3953 2003 4.961213
25 3953 2004 0.000000
26 3953 2005 0.000000
27 3953 2006 5.273121
28 3953 2007 0.000000
29 3953 2008 0.000000
30 3953 2009 0.000000
31 3953 2010 5.591221
32 3953 2011 0.000000
33 3953 2012 0.000000
34 3953 2013 4.797106
35 3953 2014 8.109661
36 3953 2015 0.000000
37 3953 2016 1.798583
38 3953 2017 0.000000
39 3953 2018 0.000000
40 3953 2019 0.000000
41 3953 2020 6.440142
42 3977 2000 14.236954
43 3977 2001 17.216910
44 3977 2002 10.210559
45 3977 2003 0.000000
46 3977 2004 0.000000
47 3977 2005 10.463710
48 3977 2006 0.000000
49 3977 2007 0.000000
I have tried to use Pivot table but it did not work for me.
With pandas, use DataFrame.groupby.plot by setting year as the index, grouping by station, and plotting observations:
df.year = pd.to_datetime(df.year, format='%Y')
(df.set_index('year')
.groupby('station')
.observations.plot(ylabel='observations', legend=True))
Seaborn is useful in solving these problems without much DataFrame manipulation. seaborn.lineplot can plot separate lines based on Station by setting the hue:
# Convert to appropriate dtype
df['year'] = pd.to_datetime(df['year'], format='%Y')
# Plot
sns.lineplot(data=df, x='year', y='observations', hue='station')
plt.show()
DataFrame and imports:
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
df = pd.DataFrame({
'station': [3939, 3939, 3939, 3939, 3939, 3939, 3939, 3939, 3939, 3939,
3939, 3939, 3939, 3939, 3939, 3939, 3939, 3939, 3939, 3939,
3939, 3953, 3953, 3953, 3953, 3953, 3953, 3953, 3953, 3953,
3953, 3953, 3953, 3953, 3953, 3953, 3953, 3953, 3953, 3953,
3953, 3953, 3977, 3977, 3977, 3977, 3977, 3977, 3977, 3977],
'year': [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2000,
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2000, 2001,
2002, 2003, 2004, 2005, 2006, 2007],
'observations': [0.346518, 0.27825, 1.096147, 0.423948, 0.0, 0.0, 0.0,
0.663922, 0.0, 0.0, 0.0, 2.921322, 1.463399, 1.402697, 0.0,
0.0, 0.0, 0.0, 0.0, 2.599236, 1.428136, 5.893202, 7.227092,
6.489147, 4.961213, 0.0, 0.0, 5.273121, 0.0, 0.0, 0.0,
5.591221, 0.0, 0.0, 4.797106, 8.109661, 0.0, 1.798583, 0.0,
0.0, 0.0, 6.440142, 14.236954, 17.21691, 10.210559, 0.0,
0.0, 10.46371, 0.0, 0.0]
})

JOIN with tables without relationship

I have a report that contains many JOINS and the base of the report is a table called “table_class” (c). What I need is to compare a Date Time field of this table (table_class) with another table called “table_period”. The problem is that the table “table_period” has no relationship with the “table_class”. I need to show the PK of the “table_period” when the Start Date field (Date Time) of “table_class” is between the Start Date and End Date (both Date Time) from “table_period”.
Basically, I want to show the period by class according the period that the class occurs/occurred.
Important: the “table_period” is flexible at user level, because the period does not have fixed dates.
For example:
1st semester 2016: from Jan 01, 2016 to Jun 30, 2016
2nd semester 2016: from Jul 01, 2016 to Dec 31, 2016
1st semester 2017: from Feb 01, 2017 to Jul 31, 2017
2nd semester 2017: from Aug 01, 2017 to Jan 31, 2018
And go on…So, I can’t fix the period.
How can we do this? Is it possible to create a JOIN with this scenario or even solving with a CASE expression?
To clarify better, we can see an example of those tables bellow.
Table 1: table_class (c) (reminding that this table is the base of the report)
CLASS_ID | START_DTE | END_DTE
0001 | Jun 29, 2017, 8:00 AM | Jun 29, 2017, 3:30 PM
0002 | Jan 11, 2018, 8:00 AM | Jan 12, 2018, 3:30 PM
...
Table 2: table_period (p)
PERIOD_ID | START_DTE | END_DTE
1st semester 2016 | Jan 1, 2016, 3:00 AM | Jun 30, 2016, 1:00 AM
2nd semester 2016 | Jul 1, 2016, 1:00 AM | Dec 31, 2016, 3:00 AM
1st semester 2017 | Feb 1, 2017, 3:00 AM | Jul 31, 2017, 1:00 AM
2nd semester 2017 | Aug 1, 2017, 1:00 AM | Jan 31, 2018, 3:00 AM
...
What I expect
c.CLASS_ID | p.PERIOD_ID | c.START_DTE | c.END_DTE
0001 | 1st semester 2017 | Jun 29, 2017, 8:00 AM | Jun 29, 2017, 3:30 PM
0002 | 2nd semester 2017 | Jan 11, 2018, 8:00 AM | Jan 12, 2018, 3:30 PM
...
Thank you!
You can do a join like this:
select c.*, p.period_id
from table_class c left join
table_period p
on c.start_dte < p.end_dte and c.start_dte >= p.start_dte;
This assigns the period -- if any -- based on when the class starts.

Clean up excessive words in a date field

I have a text filed called "TempD" in an Access table MissingTF469Temp. This field will update the date by finding it from a long string after a specific word "Effective Date". But due to a recent change in the actual string it is taking an extra letter "I" at the end of the date in some instances. I'd like to have an sql code to remove this excessive character.
Any help please.
Tue, Mar 29, 2016
Wed, Mar 9, 2016I
Fri, Apr 22, 2016
Fri, Apr 1, 2016
Mon, Apr 4, 2016
Mon, Apr 25, 2016
Mon, Mar 21, 2016
Wed, May 11, 2016
Fri, Apr 1, 2016
Mon, Apr 4, 2016
Mon, Apr 4, 2016I
Mon, Apr 4, 2016I
Mon, Apr 4, 2016I
Fri, Mar 11, 2016
Fri, Mar 11, 2016
Fri, Mar 11, 2016
Fri, Mar 11, 2016
Fri, Mar 11, 2016
Fri, Mar 11, 2016
Fri, Mar 11, 2016
Fri, Mar 11, 2016
Fri, Mar 11, 2016
Fri, Mar 18, 2016
Fri, Mar 18, 2016
Mon, Mar 21, 2016
Mon, Mar 21, 2016
Mon, Mar 21, 2016
Mon, Mar 21, 2016
Mon, Mar 28, 2016
Fri, Apr 1, 2016
Fri, Apr 1, 2016
Fri, Mar 4, 2016I
Tue, Mar 8, 2016I
Tue, Mar 8, 2016I
How did you end up in that situation? Please use date fields for dates, not characters, and insert them in ISO 8601 format, like 'YYYY-MM-DD'.
Human-readable formats like yours should be kept for presentation only.
For your question, this should do the trick:
UPDATE table
SET field_name = LEFT(field_name, len(field_name)-1)
WHERE field_name LIKE '*I';