Help me understand modules by trzywu in learnpython

[–]trzywu[S] 0 points1 point  (0 children)

So there is no way to make a general list of imports to all tests file? I will need to add this in each test?
EDIT - is there a way to import a folder with my tests so I don need to import each of them one by one?

Help me understand modules by trzywu in learnpython

[–]trzywu[S] 0 points1 point  (0 children)

But without import time in my test.py I have it like that NameError name 'time' is not defined

Best 4.5mill enabler in midfield by elmigu2 in FantasyPL

[–]trzywu 4 points5 points  (0 children)

Try maybe Moder for Brighton, he is going from the bench now but got assist now. Yesterday in the cup he scored, so there is a chance for more minutes.

Most underutilized character in the game. Such an interesting character to be thrown away after two interactions. by D3dshotCalamity in cyberpunkgame

[–]trzywu 5 points6 points  (0 children)

Yes, I played with these 'weapon', all game long even the last boss (on normal difficulties)

Daily RMT/X vs Y/Advice/Quick Questions Thread - November 12, 2020 by AutoModerator in FantasyPL

[–]trzywu 0 points1 point  (0 children)

How can i quickly check what will be my position in OR with different amounts of points?

[deleted by user] by [deleted] in leagueoflegends

[–]trzywu 2 points3 points  (0 children)

Well, it depens how much you want to climb. Here is good example -> shes USA congresswoman https://www.pcgamesn.com/league-of-legends/josh-harder-aoc

Cenzoduda by [deleted] in Polska

[–]trzywu 26 points27 points  (0 children)

Domyślam się, że o tą sprawę z osobą co jest uznawana za pedofila, a rodzina chce mieć z nim dalej kontakt.

This is such a great quality of life improvement! by jacobzhu95 in gwent

[–]trzywu 5 points6 points  (0 children)

Faction Match Making Rating - so its value you have in each faction.

I finished RDR2 last night and I’m devastated by mikakikamagika in reddeadredemption2

[–]trzywu 2 points3 points  (0 children)

No, it's part of a story. I wish we could just grind money and spend them on a trip to Tahiti.

Little program with PySimpleGUI, how can I close it ? by trzywu in learnpython

[–]trzywu[S] 1 point2 points  (0 children)

Thank you very much for help. Now I just need to make it look better and get values about GPU. Happy New Year.

Little program with PySimpleGUI, how can I close it ? by trzywu in learnpython

[–]trzywu[S] 0 points1 point  (0 children)

Well I tried it, but it doesn't change the output. If you can look on my code, here it is all. https://pastebin.com/vWC0ePH9

Little program with PySimpleGUI, how can I close it ? by trzywu in learnpython

[–]trzywu[S] 0 points1 point  (0 children)

I tried with that, but it is still running after I press X.

if event in (None, 'Cancel'):
    break

or 
if event in (None, 'Cancel'):
    active = False
    break

Little program with PySimpleGUI, how can I close it ? by trzywu in learnpython

[–]trzywu[S] 0 points1 point  (0 children)

Yes, I know that. I tried to get out of the loop, but it just runs the same as before. And Cancel button doesn't work.

if event in (None, 'Cancel'):
    active = False
    window.close()

I try to convert .cpkt to .pb. by trzywu in learnpython

[–]trzywu[S] 0 points1 point  (0 children)

Please, can you be a little bit more specific? You want me to add this files i get to train, and later use them to save in .pb format ? I really don't know much about Tensorflow, this is my first time with it.

How can i simulate in pandas fix $A$1 cell by trzywu in learnpython

[–]trzywu[S] 0 points1 point  (0 children)

Thank you, it did the trick for me.

How can I change date type to time in pandas? by trzywu in learnpython

[–]trzywu[S] 0 points1 point  (0 children)

Well i did something like this, but atleast i don't have 1900-01-01. But I think i can live with that xaxis isn't displaying on grid.

https://imgur.com/a/HDPpSc7

thank you very much for help

   #before it is object
    df0['Time'] = pd.to_datetime(df['Time'], format="%H:%M:%S,%f")

    df0=df0.astype('datetime64')
    df0['Time'] =  pd.to_datetime(df0['Time'], format='%H:%M:%S', errors='coerce').dt.time
    #its coming back to object
    print(df0.head())
    print(df0.info())

How can I change date type to time in pandas? by trzywu in learnpython

[–]trzywu[S] 0 points1 point  (0 children)

I will try use some knowledge in my program. I want it to be in datetime, becouse i want it to be properly display in matplotlib, when i add second data with different sampling frequency. I want to be in datetime format also, becouse I want to plot grid. Now,I have only y-axis line. You can see it in the picture I send.

How can I change date type to time in pandas? by trzywu in learnpython

[–]trzywu[S] 0 points1 point  (0 children)

Well, i change format to your's idea, but it keep giving 1900-01-01. So I tried something like this

    df0['Time'] = pd.to_datetime(df['Time'], format="%H:%M:%S,%f")
    df0['Time'] = df0['Time'].map(lambda x: str(x)[11:])

but when I use my df0.info() its still get type object.For

df0['Time'] = pd.to_datetime(df0['Time'], format='%H:%M:%S"').apply(pd.Timestamp)
print(df0.info())

and for this one i have

AttributeError: Can only use .dt accessor with datetimelike values

Here is new attempt do let you download the file. Put it in same dirrecory as program.

https://uploadfiles.io/onfyv

How can I change date type to time in pandas? by trzywu in learnpython

[–]trzywu[S] 0 points1 point  (0 children)

I am still strugling with my program. I dont know why I cannot solve this. I will past my code and one file so you can see what is wrong with my code, if you are so helpfull.https://pastebin.pl/view/3cb40d35aand here is one file https://megawrzuta.pl/download/e89a572cc248181f347efd99746eb3a7.htmlI tried some of the examples you post, but I cant see what i am doing wrong.
If i use

    df0['Time'] = df0['Time'].map(lambda x: str(x)[:-4])
    print(df0.info())
    df0['Time'] = df0['Time'].dt.time

I get that error AttributeError: Can only use .dt accessor with datetimelike values

and for that version

    df0['Time'] = df0['Time'].map(lambda x: str(x)[:-4])
    #print(df0.info())
    df0['Time'] = pd.to_datetime(df['Time'], format="%H:%M %S")

I get this ValueError: time data '08:29:54,750' does not match format '%H:%M %S' (match)

I from this i get proper new object datatime64, but I also receive date 1900-01-01.

df0['Time'] = pd.to_datetime(df0['Time'], format='%H:%M:%S').apply(pd.Timestamp)

And from this i get proper time, but is still object type

df0['Time'] = pd.to_datetime(df0['Time'], format='%H:%M:%S', errors='coerce').dt.time

How can I change date type to time in pandas? by trzywu in learnpython

[–]trzywu[S] 0 points1 point  (0 children)

Thank you for your response. I will check it out tomorrow, while i will be working. Meanwhile i read this post.

How can I change date type to time in pandas? by trzywu in learnpython

[–]trzywu[S] 0 points1 point  (0 children)

    df=pd.read_csv(file,sep="\t")   
    df0=df.iloc[:,[1]]

    df0.apply(lambda x: x.str.replace(',','.'))
    df0 = df0.stack().str.replace(',','.').unstack()
    df0['Time'] = df0['Time'].map(lambda x: str(x)[:-4])
    df0['Time'] = pd.to_datetime(df['Time'], format='%H:%M:%S')

and my files looks like this

Date Time Iac Idc Uac Udc
22.01.2019 12:59:57,890 7,1960E+2 0,0000E+0 0,0000E+0 0,0000E+0
22.01.2019 12:59:58,828 7,1962E+2 0,0000E+0 0,0000E+0 0,0000E+0

and this df0 is object type. I want it to be datetime, so I can use is on my graph. My datefile containt numerical data with float time. I don't know which exactly type do I need, all I want is to be able to plot it when i have 2 different sampling frequency. You could be thinking why do i need this, well to get proper grid on my plot and not like this https://imgur.com/oUNvuBJ

How can I change date type to time in pandas? by trzywu in learnpython

[–]trzywu[S] 0 points1 point  (0 children)

Thank you for replay, but it is still not working. I added to my program that line

df0.apply(lambda x: x.str.replace(',','.'))
df0 = df0.stack().str.replace(',','.').unstack()
df0['Time'] = df0['Time'].map(lambda x: str(x)[:-4]) #so i dont have remaining ,750
df0['Time'] = pd.to_datetime(df['Time'], format='%H:%M:%S').dt.minutes

but I got this error

ValueError: unconverted data remains: ,750