array   3837

« earlier    

python - How to access the ith column of a NumPy multidimensional array? - Stack Overflow
To split a 2D array into its columns the easiest approach is to transpose the array and get all the resulting rows, which, are in effect the columns of the original 2D array.
stackoverflow  howto  example  python  python2.7  get  columns  2d  array  two  dimension  rows  transpose  method  numpy  pandas 
2 days ago by racl101
Python: Append item to list N times - Stack Overflow
This would be the equivalent to PHP's array_fill method. Allows you to append to an existing array the same item n times.
stackoverflow  python  python2.7  howto  append  array  list  same  item  multiple  times  example  guide  reference 
4 days ago by racl101
Fastest way to interface between live (unsaved) Excel data and C# objects - Stack Overflow
void AssignArrayToRange()
{
// Create the array.
object[,] myArray = new object[10, 10];

// Initialize the array.
for (int i = 0; i < myArray.GetLength(0); i++)
{
for (int j = 0; j < myArray.GetLength(1); j++)
{
myArray[i, j] = i + j;
}
}

// Create a Range of the correct size:
int rows = myArray.GetLength(0);
int columns = myArray.GetLength(1);
Excel.Range range = myWorksheet.get_Range("A1", Type.Missing);
range = range.get_Resize(rows, columns);

// Assign the Array to the Range in one shot:
range.set_Value(Type.Missing, myArray);
}
excel  vsto  write  array 
6 days ago by adolfo1981
python - NumPy array/matrix of mixed types - Stack Overflow
Helps with creating numpy arrays with mixed types. However, if you're looking to combine different multidimensional numpy arrays (with several rows and columns) into one large array of mixed types, don't use numpy.column_stack method because it will convert all of them to one type (convert ints into strings for example). Rather, use pandas concat method instead, which means you turn each multidimensional array into its own dataframe.
stackoverflow  howto  create  numpy  array  mixed  data  types  python  python2.7  example  guide  reference 
7 days ago by racl101

« earlier