Posts

Showing posts from April, 2020

Numpy and Pandas initialization and modification

Following are the methods with which you can initialise an array 1. Initialise array from numpy import ndarray a = ndarray((5,),int) 2. Initialise char numpy array import numpy as np country = np.array(['USA', 'Japan', 'UK', '', 'India', 'China']) 3. Using numpy empty chars = np.empty((3),dtype=str) 4. Make a list and convert to numpy array country=['USA', 'Japan', 'UK', '', 'India', 'China'] ll=[] for i in country:   ll.append(i) country=np.asarray(ll,dtype=str) Methods to modify numpy array 1. Expand dimension X_valcnn= np.expand_dims(X_val, axis=2) 2. Reshape X_traincnn = np.reshape(X_traincnn, (X_traincnn.shape,48,48,1)) 3. Make ndarray to 1D array y_train=y_train.ravel() 4. Convert Dataframe/series to numpy X_traincnn.to_numpy()

MS Word Page numbering for Reports

Image
We all have faced problems while numbering the pages for reports where page numbers start from page 2 which is numbered as (i). Then we have pages numbered from main content with numbering as page (1) which is very difficult sometimes. Images are related to Microsoft Word 2007. Steps to follow: 1. Click on the  Paragraph symbol. It can be found in  the Home Tab. You will find section breaks that are already applied. Remove the section breaks by the simple cut(Backspace). 2. Add section breaks to one page before the Index and Introduction page. It can be found Page Layout Tab.    3. Add page number after clicking on a page required section(in this case List of abbreviations page). a) Click at image marked point(1) b) Select the page number style from image marked point(2). It will get applied. c) Select the page number from the page and format according to the need from image mark...