Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

list of numbers

import numpy as np

Vi = 0 # Initial value
Vf= 10 # Final Value

## Two ways (A and B)

#  A) list (E_l ): 
''' Use range function in Python 3.x range is a iterator you need to convert it to a list''';
l = list(range(Vi, Vf))

# B)list incremented by N: 
N = 0.5 # Increment by 0.5
l_by = np.arange(Vi, Vf, N).tolist()

# Print 

print(f' list = {l}')
print(f' list = {l_by}, by: {N} ')
Comment

PREVIOUS NEXT
Code Example
Python :: timestamp to date time till milliseconds python 
Python :: python create sqlite db in memory 
Python :: custom save django 
Python :: how to get dummies in a dataframe pandas 
Python :: how to open application using python 
Python :: __str__() 
Python :: how to append a number to a list in python 
Python :: write a python program to find table of a number using while loop 
Python :: python if elif else in one line 
Python :: how to know the length of a dataset tensorflow 
Python :: pandas column name equal to another column value 
Python :: palindrome string python 
Python :: python list comprehension cartesian product 
Python :: python replace string 
Python :: union dataframe pyspark 
Python :: append vs insert python 
Python :: django fixtures. To dump data 
Python :: pd.read_excel 
Python :: delete one pymongo 
Python :: python package version 
Python :: how to get images on flask page 
Python :: how to url encode using python django 
Python :: pandas replace values based on condition 
Python :: how to get bot voice channel discord.py 
Python :: python kill all threads 
Python :: move all files in directory with shutils 
Python :: python code to generate fibonacci series 
Python :: pandas change order of columns in multiindex 
Python :: how to file in python 
Python :: complex arrays python 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =