Skip to main content

Posts

Python Virtual Environment for Windows

To install Virtual Environment, run: pip install virtualenv To make a new environment: go to the specific location: cd C:\envs\ and make new environment running: virtualenv env where env is the name for the environment. To activate specific environment run: C:\envs\env\Scripts\activate.bat To install a package, run: pip install package_name or to install multiple modules from text file, run: pip install -r requirements.txt To save installed requirements to a file, run: pip freeze > requirements.txt To exit from current environment, run: deactivate To remove the specific environment just delete it from the disc.
Recent posts

Load Google Drive CSV files into Pandas on Colaboratory

Follow next steps to load .csv files with pandas on Google Colaboratory: 1) Install PyDrive which will be used to access Google Drive: 2) Next code assumes your CSV files are in a folder. It will print out the files in a folder and their unique identifiers. Replace <FOLDER ID> with the long string of numbers and letters in the URL of the folder in Google Drive. If the files are located at the top level of Google Drive, replace <FOLDER ID> with ‘root’. 3) Now the files get pulled into Google Colab. GetContentFile saves the files in the local environment and sets the names of the files. train_downloaded = drive.CreateFile({'id': '<TRAIN_FILE_ID>'}) train_downloaded.GetContentFile('train.csv') test_downloaded = drive.CreateFile({'id': '<TEST_FILE_ID>'}) test_downloaded.GetContentFile('test.csv') 4) Now comes the easy part. Since the files have been saved to the local environment, load u...

How to run TensorBoard

Running TensorBoard: tensorboard --logdir=PATH PATH is the path where the graphs are stored, ex: C:\Users\andri\machine_learning\source\01_TensorFlow\graphs It shouldn't be spaces between 'logdir and =' and '= and PATH' TensorBoard is runnning on localhost port 6006: localhost:6006 (or currently for me the address is: http://desktop-pq5sbmt:6006)

JavaScript

When JavaScript was created it's initial name was "LiveScript" with purpose to "make webpages alive" . As JavaScript evolved it became a fully independent language, with its own specification called ECMAScript . Recent versions are referenced by their ECMAScript version number(ES5, ES6). More recently the standards body has transitioned to a year-based number(ES2016, ES2017). Use source attribute to attach script files to HTML. The benefit of having separate files(rather than writing the whole script directly in html) besides readability is that the browser will download it and then store in its cache. After this, other pages that want the same script will take it from the cache instead of downloading it. So the file is actually downloaded only once. A single script tag can’t have both the src attribute and the code inside. A variable in JavaScript can contain any data. A variable can at one moment be a string and later receive a numeric value: Progr...