I wanted to ask why is it that some of my matrices in Python are missing a size value? The matrices/arrays that re defined show the numbers in them, but the size is missing and it is throwing me other errors because of it. Why is the variable explorer missing this info or why is it that Python can't identify the size?
Example of what happens
Code:
import numpy as np
import pylab
from scipy.integrate import odeint
import matplotlib.pyplot as plt
#import random
import mpl_toolkits.mplot3d.axes3d as p3
import random as randParticleCount = 100 ## of particles to generate energies for energy generation
binsize = 15 #Determines bin size for historgram of electron energies
S1 = 0.0200001 #Specify minimum radius particles may be generated
S2 = 0.0200002 #Specify maximum radius particles may be generated
phi1 = -90
phi2 = 90
phi1rad = phi1*(np.pi/180)
phi2rad = phi2*(np.pi/180)#Generate random positions for each particle between s1 and s2
#ICPositions = np.array([])
ICPositions = np.empty([3,ParticleCount],dtype = float)
SphPositions = np.empty([3,ParticleCount],dtype = float)
for i in range(0,ParticleCount):#In Spherical: Generates random position with boundaries of: S1<r<S2rrand = (S2 - S1)*rand.uniform(0,1) + S1 #Random # generation for component x between s1 and s2thetarand = (2*np.pi)*rand.uniform(0,1) #Random # generation for component y between s1 and s2phirand = np.arcsin((np.sin(phi2rad) - np.sin(phi1rad))*rand.uniform(0,1) + np.sin(phi1rad))xrand = RStart*np.sin(phirand)*np.cos(thetarand)yrand = RStart*np.sin(phirand)*np.sin(thetarand)zrand = RStart*np.cos(phirand)sphArray = np.array([RStart,thetarand,phirand])randArray = np.array([xrand,yrand,zrand])randArray = np.array(randArray,dtype = float)if ICPositions.size == 0:ICPositions = np.array([randArray])else:ICPositions = np.append(ICPositions,[randArray],axis = 0)print(ICPositions)