I'm currently trying to pass in a bunch of activity ID values from my accelerometer dataset, however when I copied my data from the original data frame to a separate array, the count value decreases instead. Here is a picture of the data count from my original data frame:
Balanced_input containing accelerometer data
So from the picture you can see that I should have 110856 counts of 6g hand XYZ accelerometer data and also 110856 counts of activity ID data (used to dictate what activity each patient is doing at an instance of time)
Below is my Python code:
# Standardize data
balanced_X = balanced_input[['Hand X 6g', 'Hand Y 6g', 'Hand Z 6g']]
balanced_Y = balanced_input['Activity ID']
scaler = StandardScaler()
balanced_X = scaler.fit_transform(balanced_X)
scaled_X = pd.DataFrame(data = balanced_X, columns = ['X', 'Y', 'Z'])
scaled_X['Activity ID'] = balanced_Y.to_numpy()
scaled_X['Activity ID'] = balanced_Y.values
scaled_X.count()
But the output I got was: output from Jupyter
Since I copied the 6g hand xyz data values to my new array, I should be getting 110856 counts of data, however that isn't the case.
I originally thought that the issue was caused by the ambiguity of the name (I had 2 different hand XYZ data, one was the 2g accelerometer data which has a different value count, and the other was 6g, which was the one I wanted), but I already made sure to name the array I wanted correctly when I copied my data from my original input data. Anyone know why is the code acting like this?
question from:
https://stackoverflow.com/questions/65942760/decrease-in-data-count-when-copying-data-from-dataframe 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…