can't use Python in Materialise Mimics

2022-03-26 Thread Timo Meijer


Dear Sir/Madam,

Due to uknown reasons my materialise mimics floating license does not recognize 
Python.
I have installed it under my C drive, program files, Python. But when selecting 
this folder it says it does not contain the program. I have followed these 
steps:

https://www.youtube.com/watch?v=iVBCNZykcrc&ab_channel=MaterialiseMedical

But unfortunately it does not work.
Could you help me out?

Kind regards,

Timo Meijer
0031651634920

Verzonden vanuit Mail voor 
Windows

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: can't use Python in Materialise Mimics

2022-03-26 Thread dn
Dear Timo,


On 27/03/2022 08.29, Timo Meijer wrote:
> 
> Dear Sir/Madam,
> 
> Due to uknown reasons my materialise mimics floating license does not 
> recognize Python.
> I have installed it under my C drive, program files, Python. But when 
> selecting this folder it says it does not contain the program. I have 
> followed these steps:
> 
> https://www.youtube.com/watch?v=iVBCNZykcrc&ab_channel=MaterialiseMedical
> 
> But unfortunately it does not work.
> Could you help me out?


Step 1 is to ensure that Python is working on that machine.
In the Documentation, please find:
https://docs.python.org/3/using/windows.html
https://docs.python.org/3/faq/windows.html

Step 2 (if necessary) will be to seek support under the software's
license terms.
-- 
Regards,
=dn
-- 
https://mail.python.org/mailman/listinfo/python-list


save data from multiple txt files

2022-03-26 Thread alberto
Hi to everyone, 
I would save data from multiple files in one using pandas. 

below my script 

# Read results GCMG LAMMPS 

import pandas as pd
import os
import glob

path = 
r"C:\Users\Documenti\Pyton\plot\results_CH4_180K\METHANE_180K_LJ_2.5-35.0_bar"
os.chdir(path)
results = pd.DataFrame()

for counter, current_file in enumerate(glob.glob("results_*.log")):
gcmcdatadf = pd.read_csv(current_file, header=2, sep=" ", usecols=[1, 2, 3])
print(gcmcdatadf)
results = pd.concat([results, gcmcdatadf])

#results.to_csv('resuls_tot.log', header=None, sep=" ")

In console I obtain 
Empty DataFrame
Columns: [182.244, 10, 0.796176]
Index: []
Empty DataFrame
Columns: [181.126, 12.5, 0.995821]
Index: []
Empty DataFrame
Columns: [180.419, 15, 1.21188]
Index: []
Empty DataFrame
Columns: [179.8, 17.5, 1.43485]
Index: []
Empty DataFrame
Columns: [198.308, 2.5, 0.255925]
Index: []
Empty DataFrame
Columns: [179.68, 20, 1.65276]
Index: []
Empty DataFrame
Columns: [179.629, 22.5, 1.91916]
Index: []
Empty DataFrame
Columns: [179.838, 25, 2.20493]
Index: []
Empty DataFrame
Columns: [179.73, 27.5, 2.5408]
Index: []
Empty DataFrame
Columns: [179.645, 30, 2.98309]
Index: []
Empty DataFrame
Columns: [179.799, 32.5, 3.65617]
Index: []
Empty DataFrame
Columns: [180.184, 35, 22.3041]
Index: []
Empty DataFrame
Columns: [187.835, 5, 0.427784]
Index: []
Empty DataFrame
Columns: [183.896, 7.5, 0.606451]
Index: []

#results.to_csv('resuls_tot.log', name=(T [K],))

How could I eliminate 'index:[]', an print results in one file as
#T Pres Density
198.308, 2.5, 0.255925
.
.
. 
180.184, 35, 22.3041

regards 
A.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: save data from multiple txt files

2022-03-26 Thread Cameron Simpson
On 26Mar2022 15:47, alberto  wrote:
>Hi to everyone,
>I would save data from multiple files in one using pandas.
>below my script

Well, it looks like you're doing the right thing. You've got this:

results = pd.DataFrame()
for counter, current_file in enumerate(glob.glob("results_*.log")):
gcmcdatadf = pd.read_csv(current_file, header=2, sep=" ", usecols=[1, 
2, 3])
print(gcmcdatadf)
results = pd.concat([results, gcmcdatadf])
#results.to_csv('resuls_tot.log', header=None, sep=" ")

You're printing `gcmcdatadf`:

Empty DataFrame
Columns: [182.244, 10, 0.796176]
Index: []
Empty DataFrame
Columns: [181.126, 12.5, 0.995821]
Index: []

It looks to me like it is getting the column names from the wrong row of 
data. You have supplied `header=2`, which says that row 2 contains the 
column names. Rows count from 0 in this context; maybe you want 
`header=1`? Have a look at one of the log files to check.

Also, are there data lines in these files? Just wondering, since it says 
"Empty Dataframe".

The docs for `read_csv()` are here: 
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html#pandas.read_csv

You've also commented out:

#results.to_csv('resuls_tot.log', header=None, sep=" ")

which means you're not printing the concatenated results to a file. Also 
note that your final output is `'resuls_tot.log'` (which looks 
misspelled).  This is in the same directory as the other 
`"results_*.log"` files which means that if you run this again you will 
pick up the concatenated results along with the original files. I'd give 
it another name which will not match your pattern, such as 
`"all_results.log"`.

Cheers,
Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list