How to concatenate a data frame to a new column - title

enter image description here
I’ve tried modifying syntax.
I’m expecting a new dataset an I only get rows, no columns.

Related

Updating data frame specific column values in a row using loop

I have a data frame having 2 columns, imagename and its class. Now I want to add its corresponding features extracted from the image. This feature is a list of 10 entries(LBP).Below is the dataframe.
How can I update these A->J column
I have tried using dataframe.loc with image name as input but error.
Dataset.loc('ISIC_0028714')=Feature_vector

Adding multiple columns from a pandas data frame into a new column

I ran some code which resulted in either a 1 if something happened or a 0 if it did not. The results are stored in 8 separate columns (count600, count800, etc) which visual studio has as a list type. I then added the 8 columns together and have the results appear in a new column titled SUM_OVER90th. The value stored in the SUM_OVER90th appears like 11111.0 instead of the value 5. I tried a few different scripts which all seem to give a similar result. I'm not sure why I'm not able to add these column together. Thanks for any advice on what I might be doing wrong!
COLS_TO_ADD = ['600_COUNT','800_COUNT','1000_COUNT','1200_COUNT','1400_COUNT','1600_COUNT','1800_COUNT','2000_COUNT']
Q_ETL_sub['SUM_OVER90th'] = Q_ETL_sub[COLS_TO_ADD].sum(axis=1)
enter image description here
One possible reason is that your columns to add are strings, not numbers. You can verify this with
Q_ETL_sub.dtypes
and if they are not numbers, try convert them into integer with
Q_ETL_sub[COLS_TO_ADD] = Q_ETL_sub[COLS_TO_ADD].astype(int)

do I need to remove datatable before filling it again with a different query?

I am filling a datatable called 'Reports', then clearing it and filling it with a different query. The problem is, when I fill it the second time, the datatable is not filled out correctly. There are extra columns and it is not in the same order as my query. I am using the dataset visualizer to see the contents of the datatable while i am debugging. Is there something I need to be doing to the datatable other than
ds.table("Reports").clear
before i fill the table again? I figured out if I remove the table completely before I fill it again, then the table is filled out right the second time.
Current code structure goes something like this when filling the table the second time:
ds.tables("Reports").clear
reportSQL = "select field1, field2 from table"
daReports = New NpgsqlDataAdapter(reportSQL, con)
daReports.Fill(ds, "Reports")
At this point, the table is filled out incorrectly. It only works when i add this before i fill the table:
ds.tables.remove("Reports")
Is this the right way to go about filling a datatable multiple times with different queries?
ds.table("Reports").clear only clears rows collection from the datatable (similar to ds.table("Reports").Rows.clear). In addition to that you need to clear columns collection:
ds.table("Reports").Columns.Clear()
This will get rid of extra columns

Combining data from different columns into a line graph with SSRS

Hi I am new to SSRS and I am trying to create a line graph from the following dataset that has a single line and I am confused with how to achieve this simple task.
column1|column2|column3
1,11,35
If I try and add column 1-3 as values it will show nothing because it is trying to do a separate line per column.
I have tried making a temp table in sql and reformatting it as follows:
values
1
11
35
This works however this causes me to lose the axis names for each value.
How can I achieve a single line in my line graph as well as keeping the axis names?
You're correct in that you need separate rows (i.e. pivoting your data) to meet your chart requirements.
You can need to add another column to your new Dataset to have group names, too:
Just example names, obviously.
In your chart, add the Series and Category as required:
Now you have labels on the axis:

Display Headers in Infragistics ULTRAGRID when no data in table

I am fetching data in from an SQL table using a DataSet in VB.Net. When there is data in table, it displays the data properly in the grid, but when there is no data in the table, it only shows the UltraGrid's basic view.
How can I display the column names of the table as headings of the UltraGrid even when there is no data in Table?
Thanks for the reply, but I think the problem that JD is having is a bit different from mine - in my application the data got fetched properly from SQL Server. My problem is that when there is no data in the table, I want to display the columns of the table as the headings of the grid with 0 rows. This is not happening.
It just shows a message box saying that no data is found, and the UltraGrid shows as it does by default in the application.
This is discussed in this Infragistics forum thread.
Do you know what the headers of the columns will be or is it dynamic based on the data in the table? If you know beforehand you can create the columns with the appropriate headers in an empty dataset and assign that to the grids datasource.
I notice this same behavior when I manually create a datatable and assign it as the grid's datasource. If the data table is empty, all the column header info that was previously set on the grid is lost. My solution to this was to never actually give it an empty table, if I have no rows in my table, at least have all the columns defined.
DataTable table = new DataTable("fooTable");
table.Columns.Add("fooCol1", typeof(long));
table.Columns.Add("fooCol2", typeof(string));
table.Columns.Add("fooCol3", typeof(bool));
myUltraGrid.DataSource = table;
By never setting the grid to an empty table, you keep your header info.