##### Results
Search Results
Post Author Forum Replies Posted [asc]

 For the first matrix (use the same strategy for the other one) Paul import numpy as np n = 5 M = np.ones( (n,n) ) i = np.arange(1,n) M[i,i-1] = 10*M[i,i-1] print(f'M = {M}')Output:M = [[ 1. 1. 1. ...
paul18fr Data Science 1 37 7 hours ago

 (Jan-13-2022, 12:00 AM)armitron121 Wrote: .... t am stuck on how to transpose it. Any advice? With Pandas transpose ?
paul18fr Data Science 1 90 Jan-13-2022, 07:31 AM

 Commas are missing in your list. Here after another 2 ways. Note that in your example you've a single row and that's why flatten has been used. ### from a list MyArray = [[1.6727031, 1.5464988, 1.68...
paul18fr General Coding Help 2 109 Jan-12-2022, 07:18 AM

 What type of data are you dealing with in the original csv file? pure numbers? strings? both? The Appending is costly, and maybe loops can be avoided using vectorisation if data are numbers.
paul18fr General Coding Help 7 274 Dec-27-2021, 12:22 PM

 Maybe with: import itertools as it the_dictionary_list = {'Color': ['Amarillo.png', 'Blanco.png', 'Rojirosado.png', 'Turquesa.png', 'Verde_oscuro.png', 'Zapote.png'], 'Cuerpo...
paul18fr General Coding Help 2 234 Dec-26-2021, 12:37 PM

 You may also use Pandas and Numpy to deal with huge files; just an example here bellow import pandas as pd import numpy as np import os Path=str(os.getcwd()) CsvFile1='data1.csv' CsvFile2='data2.cs...
paul18fr General Coding Help 5 349 Dec-14-2021, 07:34 PM

 Maybe you can use the following code to create a (numpy) array? import pandas as pd MyFile = 'file.txt' MyResults = pd.read_csv(PATH + '/' + MyFile, header = None, delimiter = ' ') MyArray = pd.Data...
paul18fr Data Science 3 338 Dec-04-2021, 10:29 AM
Post: Program workflow tool

 All I'm wondering what type of graphical tool I Can use to build workflow of a project (involving modules, dozains of functions, external programs and so on). Never used it so far, but I'm looking for...
paul18fr General Coding Help 0 179 Dec-03-2021, 08:53 AM

 If you're using arrays (1D/2D), you can use numpy.savetxt to have a cvs like file
paul18fr General Coding Help 2 282 Nov-25-2021, 07:24 AM

 Here are some changes. For example you can bracket abcissa values or ordinates ones, or you can also implemente Latex formula, and so on. There are many options import matplotlib.pyplot as plt import...
paul18fr General Coding Help 5 517 Nov-21-2021, 08:40 AM

 The following code works for me import pandas as pd import os PATH=str(os.path.abspath('')) FilesList=['VY6_Row1_report_url.xlsx', 'VY6_Row2_report_url.xlsx'] NumberOfFiles=len(FilesList) # first ...
paul18fr General Coding Help 2 367 Nov-17-2021, 08:20 AM
Post: RE: Plot 3 variables

paul18fr General Coding Help 3 418 Nov-08-2021, 04:50 PM
Post: List comprehension:

 Hi I'm trying to figure out how a list comprehesion works from a "memory" point of view? I mean that append corresponds to a dynamic allocation memory, but what about the list comprehension? In oth...
paul18fr Data Science 1 304 Oct-29-2021, 04:56 PM

 Thanks for the help; it works perfectly
paul18fr Data Science 3 732 Oct-13-2021, 08:31 PM

 Hi I'm working with dictionaries where values are (numpy) arrays, and I'm trying to figure out how to export these dictionaries in an JSON format, and how to read it afterward. I'm not familiar with...
paul18fr Data Science 3 732 Oct-12-2021, 06:22 AM
Post: RE: [solved] Sort list

 Thanks to all for their support and advices (as well as for internet links)
paul18fr General Coding Help 5 930 Jul-10-2021, 10:05 AM
Post: [solved] Sort list

 Hi I've been trapped by names I've been getting in a list; I spent some time in looking in internet to find a way; in the current example, I want that list index 1 correspond to 'Name_2' and not 'Nam...
paul18fr General Coding Help 5 930 Jul-09-2021, 05:21 PM

paul18fr General Coding Help 4 906 Jun-21-2021, 04:25 PM

 Hi To higlight reading by adding comments, I'm looking for a way to split function arguments into several lines; nevertheless using backslash I'm facing to an error (I'm still digging on internet in ...
paul18fr General Coding Help 4 906 Jun-21-2021, 01:10 PM

 I'm not a regex expert, but the following code might help you import re # line = " 0 2 0 -15000 0" line = "50 2 2 -14950 3" Valu...
paul18fr General Coding Help 4 952 Jun-16-2021, 12:13 PM