Tumgik
netcrowl · 3 years
Text
Python3: Dictionaries
Since now all of the compound data types we have seen in detail are sequential collections. This means that the items in the collection are ordered from left to right and they use integers as indices to access the values they contain. Dictionaries are a different kind of collection. They are Python’s built-in mapping type. A map is an unordered, associative collection. The association, or…
View On WordPress
0 notes
netcrowl · 3 years
Text
Calendar
If you have read my Python posts and followed along with the examples I’m sure that you are able to write a more complicated program. Let’s see how to build a calendar! import PyQt5 from PyQt5.QtWidgets import * from PyQt5 import QtCore, QtGui from PyQt5.QtGui import * from PyQt5.QtCore import * import sys class Window(QMainWindow): def…
Tumblr media
View On WordPress
0 notes
netcrowl · 3 years
Text
Python and Data Files
Python and Data Files
Python can easily interact with different file formats (images, texts, music etc.). In this post we will assume that our data are text-files filled with characters. For better understanding: 1.Open your favourite page in wikipedia2.Copy some text3.Paste it in a new text editor file on your current working directory4.Save it as ‘my_text.txt’ fileref = open('my_text.txt', 'r') for aline in…
View On WordPress
0 notes
netcrowl · 3 years
Text
Machine Learning
Many reasons can make you visit my blog. Either by chance or etheir by will you may want to learn coding in Python or learn IT stuff. If you are a Data Scientist you can find a quick Machine Learning repository on my GitHub where you can fmake your first steps toward it. You can find everything here https://github.com/NetCrowl/ML-mini-course
Tumblr media
View On WordPress
0 notes
netcrowl · 3 years
Text
Permissions
Unix operating systems are not only multitasking systems but also multi-user systems. This actually means that more than one person can be using the computer at the same time. For example while a single user is using the keyboard and monitor another user can be connected via ssh ( we will talk later about it) and operate the computer. The multiuser capability comes from the era when computers…
Tumblr media
View On WordPress
0 notes
netcrowl · 3 years
Text
Creating Python applications
On our previous post we saw how to create an .exe file for Windows. In this post we will see another way for this which can expand also in other systems. For this purpose we will use the PyInstaller , which bundles a Python application and all its dependencies into a single package. The user can run the packaged app without installing a Python interpreter or any modules. PyInstaller supports…
View On WordPress
0 notes
netcrowl · 3 years
Text
Run python files as .exe
Run python files as .exe
On a previous post we saw step by step how to install Python on our system. We talked about IDE and how to get a text editor. Although we write our code there is the need to have installed Python in our system. Also the only way we have seen up to now to run our programs is either by the command line or by the IDE. As a Linux lover using Python is part of the system but what about different…
View On WordPress
0 notes
netcrowl · 3 years
Text
Linux Command Line Keyboard Tricks
Linux Command Line Keyboard Tricks
Using the command line means that you must type commands that can be also executed with a click of your mouse. So why to learn using the CLI? Well as we have seen so far is a powerful way to interact with our computer. In this post we will see some tricks that will help us not only type our commands but also moving around the shell without even touching our mouse. Cursor Movement KeyActionCtrl…
View On WordPress
0 notes
netcrowl · 3 years
Text
Lists
Lists in python are sequential collections of data values. Each value, which is called element, is identified by an index. Strings are like lists, ordered collections of characters, but there are many more. Create a list by using [ ]. For example: t = [] #empty list t = [10, 20, 30, 40] #list of numbers t = ["eggs", "pan", "omelette"] #list of strings t = [10, "people", 30, [40, 50]] #mix list…
View On WordPress
0 notes
netcrowl · 3 years
Text
What is an API
What is an API
Application Programming Interface (API) is an interface that defines interactions between multiple software applications or mixed hardware-software intermediaries. It defines the kinds of calls or requests that can be made, how to make them, the data formats that should be used, the conventions to follow, etc. It can also provide extension mechanisms so that users can extend existing…
Tumblr media
View On WordPress
0 notes
netcrowl · 3 years
Text
load_dictionary.py
# Load a text file as a list. # Args: # 1.text file name and directory if needed import sys def load(file): try: with open(file) as in_file: loaded_txt = in_file.read().strip().split('\n') loaded_txt = [x.lower() for x in loaded_txt] return loaded_txt except IOError as e: print("{}\nError opening{}.Terminating program".format(e, file),file=sys.stderr) sys.exit(1)
View On WordPress
0 notes
netcrowl · 3 years
Text
satellite.py
In this script we will plot the position of ISS. In order to do this we will use this API. Import the required modules pandas and plotly import pandas as pdimport plotly.express as px We will use the API found here. url = 'http://api.open-notify.org/iss-now.json' Next we need to read our data which are in a json format (some kind of file) dataFrame = pd.read_json(url) Print the dataFrame…
Tumblr media
View On WordPress
0 notes
netcrowl · 3 years
Text
Bash Shell
Have you ever thought what is going on in your system after you press Enter key? We are going to explore this feature of the shell. Expansion Expansion is the process of entering something in our shell and after it is expanded into something else before the shell acts upon it. Let’s take a look of the echo command. This command it prints its text arguments on standard output. [me@linuxbox ~]$…
Tumblr media
View On WordPress
0 notes
netcrowl · 3 years
Text
Jupyter Notebook Guide
The Jupyter Notebook interface is a web-based application for authoring documents that combine live-code with narrative text, equations and visualizations. More applications: Jupyter LabJupyter HubJupyter ConsoleJupyter QtConsoleJupyter Kernels Try Jyputer Try Jupyter (https://try.jupyter.org) is a site for trying out the Jupyter Notebook, equipped with kernels for several different languages…
Tumblr media
View On WordPress
0 notes
netcrowl · 3 years
Text
Python3: Strings
Since now we have seen some strings as characters inside quotes. Now is time to explore them in much more detail. We can think strings as smaller strings made up from single characters. Types that are comprised of smaller pieces are called collection data types. Operations on Strings One thing that makes strings different from some other Python collection types is that you are not allowed to…
Tumblr media
View On WordPress
0 notes
netcrowl · 3 years
Text
Pandas DataFrame ultraquick lesson
Pandas DataFrame ultraquick lesson
A DataFrame is similar to an in-memory spreadsheet. Like a spreadsheet: A DataFrame stores data in cells.A DataFrame has named columns (usually) and numbered rows. import numpy as np import pandas as pd Creating a DataFrame The following code cell creates a simple DataFrame containing 10 cells organized as follows: 5 rows2 columns, one named temperature and the other named activity The…
Tumblr media
View On WordPress
0 notes
netcrowl · 3 years
Text
NumPy ultraquick lesson
import numpy as np Call np.array to create a NumPy matrix with your own hand-picked values. For example, the following call to np.array creates an 8-element vector: one_dimensional_array = np.array([1.2, 2.4, 3.5, 4.7, 6.1, 7.2, 8.3, 9.5]) print(one_dimensional_array) You can also use np.array to create a two-dimensional matrix. To create a two-dimensional matrix, specify an extra layer of…
Tumblr media
View On WordPress
0 notes