我正在尝试合并或连接通过python循环生成的表。 这就是我所拥有的:
<h:form>
<h:inputText valueChangeListener="#{bean.onNewValue}" value="#{bean.value}">
<f:ajax event="keyup" render="@form" execute="@form"/>
</h:inputText>
</h:form>
基本上,我想添加到与请求表具有相同列的原始request1表中,但是,我得到一个错误: “您正在尝试合并object和float64列。如果要继续,则应使用pd.concat。”
答案 0 :(得分:2)
您可能想使用 public class MainActivity extends Activity
{GridView grid;
String url="http://dstreet.site/";
String link,title,src;
ArrayList list= new ArrayList();
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Scrapper();
grid = (GridView)findViewById(R.id.grid);
grid.setAdapter(new ImageAdapter(this, list));
}
public class ImageAdapter extends BaseAdapter {
ArrayList list;
private LayoutInflater inflater;
Context c;
int mCount;
ImageAdapter(Context context, ArrayList list) {
inflater = LayoutInflater.from(context);
c = context;
mCount = list.size();
this.list=list;
}
@Override
public int getCount() {
return mCount;
}
@Override
public Object getItem(int position) {
return true;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View
convertView, ViewGroup parent) {
final ViewHolder holder;
View view = convertView;
if (view == null) {
view = inflater.inflate(R.layout.img, parent,
false);
holder = new ViewHolder();
assert view != null;
holder.imageView = (ImageView)
view.findViewById(R.id.image);
view.setTag(holder);
} else {
holder = (ViewHolder) view.getTag();
}
Picasso.get()
.load(list.get(position))
.placeholder(R.drawable.ic_launcher)
.error(R.drawable.ic_launcher)
.fit()
.into(holder.imageView, new Callback() {
@Override
public void onError(Exception p1)
{holder.imageView.setVisibility(View.INVISIBLE);
// TODO: Implement this method
}
@Override
public void onSuccess() {
holder.imageView.setVisibility(View.VISIBLE);
}
});
return view;
}
}
static class ViewHolder {
ImageView imageView;
}
public void Scrapper()
{
Content content= new Content();
content.execute();
}
public class Content extends
AsyncTask<Void,Void,Void>
{
@Override
protected Void doInBackground(Void[] p1)
{
// TODO: Implement this method
try
{
Document doc = Jsoup.connect(url).get();
// Identify Table Class "worldpopulation"
for (Element table :
doc.select("div[class=poster]")) {
Elements imgSrc =
table.select("img[src]");
// Get only src from img src
src = imgSrc.attr("src");
list.add(src);
}
Log.d("image links",list.toString());
}
catch (IOException e)
{e.printStackTrace();
}
return null;
}
}}
concat