I have a .mat file with the name faceDatasetGroundTruth.mat (a struct) that contains a table (called 'faceDataset') with two columns.
Each value in the second column starts and ends with a ' character, which I'd like to remove so that I'm only left with [95,71,226,313] in the first row, for example (see attached image).
How can I remove the ' symbol from the second column of the table?
Thank you.
Related
I have to split the content of a column into 2 differents columns using the QGIS Field Calculator. Basically, my table is something like that:
Basically I have to work with descriptio column omitting characters from 1-12 and then copy next 8 characters (in this case "AgilisSi") into the PresLACAGI column.
The other element to copy is the final number in descriptio column, ranging from 1 to 3 characters. Possibly the best is thing would be a syntax that reproduces in CodiClapa column the number after ": ", including the space in the syntax.
Thanks a lot!
Use the field calculator, check Update existing field and select column from drop down and type in the Expression window for:
PresLACAGI: substr(descriptio,12,8)
CodiClapa: right(descriptio,3)
How would you fill columns first with a defined variable, then move down and fill by column first?
For instance, I have an array filled with 24 names (24x1) and I want to split the names into 4 groups (columns). I want 4 names in each column till the 24th name.
There are two ways to do it
1.Transpose your matrix at the end:
example=example.'
or
example=transpose(example)
2.You can directly fill in column:
I write an example down there. The important part is a(it,1)=it
it=1;
while it~=25
a(it,1)= it;
it=it+1;
end
I have more than 100 columns in dataprep whose names are like:
my column name 1
my column name 2
I would like to rename the name of the columns to be:
my_column_name_1
my_column_name_2
I have tried to do a rename, changing " " by "_". However, dataprep only changes the first whitespace! Is there any way to change all the whitespaces?
Another question, when I do a function like rename, it is done just for a column. I can add more columns writing the name of de column. Is there any way to select all columns without writing all the names?
thank you so much!
You can shift-select multiple columns to Transform when the data is in column view mode.
Select the columns to apply to and then choose the transformation.
JSDBroughton answer did the trick for me although it's not so clear how to do it. Change your view to Columns (second icon from the left on the toolbar). Select the first column, then hold Shift and select the last column. You should now have all columns selected. Then right clock and select Rename. A new Recipe step will be added with all your columns already added. Then set the Option to "Find and replace".
In terms removing all the spaces I couldn't find any Cloud Dataprep pattern or Regular Expression which let me replace all my spaces in my columns. Having said that my columns had a maximum of 4 spaces so I simply added the same step multiple times. I used the Regular Expression \s to match spaces and I replaced them underscores.
I have a csv file containing 8 lines and 1777 columns.
I need to read all the contents in matlab, excluding the first line and first column. First line and first column contain strings and matlab can't parse them.
Do you have any idea?
data = csvread(filepath);
The code above reads all the contents
As suggested, csvread with a range will read in the numeric data. If you would like to read in the strings as well (which are presumably column headers), you can use readtable:
t = readtable(filepath);
This will create a table with the column headers in your file as variable names of the columns of the table. This way you can keep the strings associated with the data, if need be.
I have a spreadsheet that has quite a few tables and I wonder what would be the formula to lookup table name from cell in iWork Numbers? For example I have table with name TableA, inside of that table I want to put something like "=$B1" or whatever to get the name "January01" in it. Just typing it is not acceptable, cause those table names will change for multiple day of the month (we planning to have 30-31 tables in one spreadsheet and have 12 spreadsheets for number of months).
It is possible to use text in another cell to specify a sheet and/or table name in the cell or range address within a formula in another cell.
You can use the INDIRECT function.
"The INDIRECT function returns the contents of a cell or range
referenced by an address specified as a string value."
from the iWork Numbers function browser
Example:
Assume the cells in column A of a particular table contain the names of the sheets in the workbook.
In column B you could count the number of cells that contain the text 'equal' in column D of Table 1 in each sheet using:
=COUNTIF(INDIRECT($A2&"::Table 1::$D", 1),"=equal")
Here the sheet name is specified in column A so the formula can be used for the entire column without having to manually edit the formula to specify the sheet name.
According to this support forum entry that is not possible. Came across it as I was looking for a solution to the same problem.
This is a very old thread, but here is how to get the table name:
You need to use the REFERENCE.NAME function to get the name of the table (plus some extraneous info, that you get rid of by using the TEXTBEFORE function).
TEXTBEFORE(REFERENCE.NAME(SomeTableName::$A$1,1),":")
The entry "SomeTableName::$A$1" is a random cell reference (in this case cell A1) from the table whose name you are interested to get. During formula entry, you merely click on a cell of the table in question to generate this reference, and then lock cell column and row, as needed.
The parameter "1" following the cell reference tells the REFERENCE.NAME function to return the name of the table and the cell name. There is no option to return just the table name.
The TEXTBEFORE function truncates the returned string to everything before the first colon, returning just the table name.