« first day (2463 days earlier)      last day (2485 days later) » 

Cro
8:56 AM
repository github.com/tensorflow/models/tree/master/tutorials/image/… how does distorted input feed data to cifar10.inference? how does it make sure the data are different?
 
 
1 hour later…
10:20 AM
cbg
 
10:32 AM
@Cro you might want to ask that in a channel about tensorflow ;)
 
FWIW the question is perfectly python-related
@Cro the definition of cifar10.inference seems to start here, with no tensorflow experts around you should try looking at that
 
11:14 AM
I have a ataetime64[ns] type column with date as "2017-07-06 09:15:00" . I need to compare is with say "2017-07-06 10:15:00" which works fine. I write it in a script but everyday the date changes. Is there a way to just compare "yyyy-mm-dd 09:15:00" with "10:15:00"
basically ignoring the date part
 
I'm sure there is
 
jjj
If it's a DateTime object you can take just the hour, I think
 
datetime can even cook you dinner if you figure it out how
 
jjj
:D
 
I know I can split and save time in another column, then cast it to datetime again
basically removing date, and keeping time only as datetime object
 
11:17 AM
Why split and recast? Use datetime stuff.
the whole point of datetime is to avoid parsing dates by hand
 
i already do to_datetime(string in the form yyyy-mm--dd hh:mm:ss). I would like a way that only cares about time
@AndrasDeak is there a way to` to_datetime(string in the form yyyy-mm--dd hh:mm:ss)` in such a way that it can be compared to a string in form hh:mm:ss
 
In [7]: import pandas as pd

In [8]: dt = pd.to_datetime("2017-07-06 09:15:00")

In [9]: dt
Out[9]: Timestamp('2017-07-06 09:15:00')

In [10]: dt.time()
Out[10]: datetime.time(9, 15)
as I said, use datetime stuff
you should probably convert your comparison time to a datetime object as well, and perform comparison between those
In [15]: pd.datetime.time(pd.to_datetime("10:15:00"))
Out[15]: datetime.time(10, 15)
 
ok you mean rather than hard coding soomething like dt>"09:15:00" i should first cast 9:15 as datetime
 
probably not the most idiomatic approach, but I'm unfamiliar with datetimes ^
@pythonRcpp if you ask yourself that question what would you answer?
if one option is "hard-coding something like", then odds are the other option will be good for you
 
i was thinkin of some option by datetime only thta ignores date part (just like date +%Y) stuff in bash
 
11:23 AM
that's .time().......
if you don't need the date part at all, just store the .time()
I don't see your issue
 
to_time() ?
or to_datetime("yyyy-mm-dd hh:mm:ss").time()
 
try and see
or google and see
 
^ that one
you still have to parse the extra bits of the string
 
I've said more than enough for you to figure this out
 
sorry i asked trivial thing
 
11:25 AM
or, you could do strptime('%H:%M:%S', '2010-08-14 18:42:12'.split()[-1])
 
that would be pandas.datetime.strptime() which is a mouthful, using these convenience methods is probably fine
and please don't parse datetimes manually if there's a method that does that for you :P
 
but I'd probably just parse the full dt
Yes - always that^^
> Let me do a thing manually because I find the one that's written and tested already slightly more complicated
Said no successful person, ever
 
says the guy who splits the timestamp string to take its last part :P
 
2 mins ago, by Wayne Werner
but I'd probably just parse the full dt
;)
 
11:47 AM
>>> pd.to_datetime("2017-07-06 09:15:00").time()
datetime.time(9, 15) #how do i add seconds aswell
 
09:15:12
try that :)
 
i tried pd.to_datetime("2017-07-06 09:15:00",format="%h%m%s").time()
 
seriously
just try comparing some values for yam's sake
your XY problem is currently "how do I add seconds to this time object" where your X doesn't even exist
the problem you're trying to solve is "how do I compare these time objects", so try to do that first and only solve problems you actually encounter
if you see that 9:15:00 compares true with 9:15:12 as Wayne said, we can get back to this problem
 
thinking about posting a question about the import behavior I discovered yesterday... to add some interesting content to SO
 
You can create a datetime for "today at 9:15" with datetime.now().replace(hour=9, minute=15, second=0). If you have two datetimes A and B, and just want to compare the times, compare A.time() with B.time(). I'm sure all of this is in the datetime docs.
 
11:58 AM
> If you have two datetimes A and B, and just want to compare the times, compare A.time() with B.time().
we've covered this already
hence my agitation with pythonRcpp
 
I just don't understand people's hesitation to try things at the interactive Python prompt - a little experimentation usually brings the needed insights. And help(datetime.datetime) is just 23 keystrokes away (24 if you include hitting <ENTER>).
 
@Rawing I'd recommend it. It's a weird/unexpected behavior (also, who would even try that ;) and you could get some interesting answers if you word the question well
IKR? The REPL is my favorite tool
 
@PaulMcG I have a csv that has a column in string format yyyy--mm-dd hhmmss and I am writing a script that has to compare times(in file) with 9:15:00 ,10:15:00, ... I cant do pd.to_datetime("09:15:00") in my script because it adds date and I might run it on file having some other date than today.. So I need to remove the date thing altogether from file and script.
 
anyone familiar with docker?
I have docker running tensorflow
and I want to execute a script on the docker with python from my local machine
 
12:13 PM
@pythonRcpp - why is comparison using .time() not sufficient?
Oh, and "cbg"
 
cbg
 
@PaulMcG pd.to_datetime("2017-07-06 09:15:00").time()
datetime.time(9, 15) I was wondering why no seconds. for 00 seconds it doesnt show anything that got me confused on how to include seconds
 
It seems likely to me that the seconds are there, just not displayed since they're zero. You're not losing precision or anything.
 
The datetime docs are quite thorough in this regard.
 
>>> pd.to_datetime("2017-07-06 09:15:00").time()
datetime.time(9, 15)
>>> pd.to_datetime("2017-07-06 09:15:10").time()
datetime.time(9, 15, 10)
 
12:21 PM
I assure you, time has a second attribute.
Let me check - looking here docs.python.org/3/library/… Yes, there is a second attribute.
 
Something tells me that someone hasn't read my messages
 
Sometimes people get tripped up on the difference between what data is being stored, and what data is being displayed. The computer is at liberty to show you a truncated/summarized/shortened/rounded version of the true value. This may be a contradiction of people's assumption that computers can't "lie" or whatever, but so it goes.
 
I get this quite a lot with pyparsing too, since I used to display the parsed results as the list of tokens and a dict of named results. People thought they were getting back a tuple and were supposed to pick it apart.
 
@NoahCristino I do not think that means what you think it means
 
I realized a better way
I'm going to put a tcp server on the docker
and client on my machine
since I need to run a script with tensorflow on docker
get the results
and display in a gui
and the vm has no gui
 
12:30 PM
im trying to extract time from datetimestring using kk['Ts']=pd.to_datetime(kk['DateTime']).time()
 
Looks like you've done it
 
:38127465 no it dos not work >>> kk['Ts']=pd.to_datetime(kk['TradeExecutionDateTime']).time()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/pandas/core/generic.py", line 3081, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'Series' object has no attribute 'time'
 
ruh-roh
what could be the problem.
try to figure it out on your own first
 
And kk is what, a Series? a DataFrame?
 
probably a dataframe, so kk['...'] is a Series
 
12:39 PM
I already converted str column TradeExecutionDateTime to datetime . using kk['TradeExecutionDateTime'] = pd.to_datetime(kk['TradeExecutionDateTime']) which worked fine . . I can see type of TradeExecutionDateTime as non-null datetime64[ns]
 
@pythonRcpp that's good
Now you need to get the .time() of each item. Go!
 
but since i only need time I should do kk['TradeExecutionDateTime'] = pd.to_datetime(kk['TradeExecutionDateTime']).time()
 
Where did you get that from? You just pasted the error. So that's not what you should do!
 
So @pythonRcpp, actually you didn't. That statement created a Series full of Python datetimes. Through the magic of pandas, that one statement computed the datetime from each string in the 'TradeExceutionDateTime' column of each row, and then replaced that string with an actual datetime.
Despite the name, pd.to_datetime is not giving you a datetime, its giving you a Series
 
which is perfectly straightforward pandas behaviour
 
12:42 PM
And as the error message you posted says, 'Series' object aint got no attribute 'time'
 
so how should I tell it to give only time. Do I need to convert it back to string type and then try th same command
 
But each element in the Series is a datetime, and those datetimes have 'time()' methods on them. I skimmed 2 chapters of Wes McKinney's book a year ago, so my pandas knowledge is thin. But I'll bet you can iterate over that Series that was returned by pd.to_datetime, call time() on each value returned, build a new Series with that, and then stuff that back into your DataFrame kk.
 
> I need to convert it back to string type and then try th same command
why do you keep saying things like this? ^
why don't you try to stop and think for a yamming second?
 
time until Andras' explosion: < 5 hours
 
I don't even know what I'm trying to achieve any more xD
 
12:54 PM
@Rawing :| can't say that assessment is wrong
 
@pythonRcpp - you will not get very far with pandas until you get a decent grasp on its data model: when you operate on a DataFrame, when you operate on a column/Series, and when you operate on individual values of a Series.
 
cbg
 
@PaulMcG I appreciate your kind help, and everyone frustrated by my questions aswell, embarassing sometimes
 
The problem is not your questions. It's how you seemingly ignore the answers you get to your questions, and start wasting the time of all involved by not making use of the help you get.
 
Well I have the advantage of just having woken up, showered, and had my coffee (and some pan de elote)
 
1:18 PM
I have a question
So I am using opencv with the webcam to recognize faces
then crop them and save
I have a script that can detect the gender with an image input
but if I want to find the faces and detect the gender, how can I stop it from retesting the new image everytime the person moves
but still detecting the right person?
 
You'll have to use your image processing magic to detect that you are still looking at the same face as before, and not gender check it
 
but even if it changes
it could just be a slight head turn
 
Are you going to make me repeat myself?
 
I'll try that
 
cbg \o
 
1:22 PM
what is cbg?
 
It's short for "cabbage"
Which is how we say "hello" in Room 6
 
I'm pretty sure there's a whole wiki page on it
somewhere
 
@NoahCristino welcome to our chatroom, I've seen you around but maybe you should give our room rules/site a read: sopython.com/chatroom It yields some useful information like the common lingo (salad language we regulars like to use)
 
1:24 PM
ok
 
rbrb - the spice must flow... (i.e., going to work now) (which is not actual Room6 lingo, I'm just having a Dune moment)
 
2:08 PM
@Kevin are you around? So I read an article about why geometry's basics don't make any sense, that is, if a point is a 0 dimension object, how is it possible, that if you have infinite amount of them in the same direction one after another, then you would get a line, a 1 dimensional object. So I was thinking, if that is true, why don't we do the same thing with algebra? That is, if add infinite amount of 0s together, you will have a number. That is:
n ∈ ℝ; n = ∞ ⋅ 0
and in that case, n/0 makes sense, because that is
and also n/∞ = 0
 
one key element in this problem is countability
one point has zero volume (Lebesgue measure), countably many points have zero volume, continuum many points might have nonzero volume
 
but why can't it be the same for 0s?
 
DSM
Countably infinite cabbage for everyone!
 
the points that make up a line aren't just any infinite set of points, like you can't just take a single point infinitely many times and get a line
 
cbg
 
2:12 PM
cbg
 
@PeterVaro "the line is more than the sum of its parts"
 
if you add the volume of all the points in the line, you still get 0
 
cbg \o DSM and Haare
 
@AndrasDeak but that can be said about the uncountable amount of 0s
 
2:13 PM
yes, so uncountably many 0s sum up to 0
what I'm saying that is a line is more than just a sum of points
 
but how? how is it more?
 
trying to reason with geometry can lead to highly counterintuitive experiences, my go-to example is the Banach--Tarski paradox
@PeterVaro in that a line has finite "volume" while the points that make it up have zero
it only starts having a volume once it becomes a line
 
DSM
I'd avoid the "sum of points" phrase, it makes it sound like we're adding things and we're not.
 
don't take my loaded expressions away from me :P
You can actually sum a lot of real zeros and end up with a finite number...we call that integration. *puts on monocle and top hat*
 
DSM
twitch
 
2:17 PM
just the one?
is that better?
I'm not sure if your seizure is due to grammatical or mathematical reasons :D
I have a fundamental issue in drawing such parallels between geometry and algebra (number theory?), so I guess I'm not the best partner for this discussion. Which reminds me that Kevin was the addressee, so I'll just leave it at this :P
 
DSM
I was too busy reacting to that definition of integration to notice any grammar issues :-P
 
hehe :D
 
@AndrasDeak I've just finished reading that article.. tough :)
 
let's not delve into the depths of infinitesimal theory
 
You don't reason with math, math reasons with you
 
2:20 PM
*in Soviet Russia
 
yea
In Soviet Russia you don't reason with math, math reasons with you
 
DSM
In Soviet Russia, spheres decompose you into two equivalent objects!
6
 
TIL in 1989 The Soviet Union Traded 17 submarines, a cruiser, a destroyer and another ship to Pepsi, so Pepsi would sell their products in Soviet Union....
Man I should stop reading random facts online and be productive today :(
 
All that arsenal still wasn't enough to make Pepsi drinkable.
 
Trying to save file to sharepoint library with script on Windows. I can do it easily if I map the sharepoint url to a network drive but I want it to run for people who aren't mapped to that specific drive. So I'm just trying to save via the url. It doesn't look like python thinks it's a valid path. Though, Word/Excel let you save files via url if you're logged in so I'm assuming it's possible. Anyone know where I might poke first?
 
2:28 PM
Random Fact: There's a type of Japanese honey bee that cooks any hornets that enter their hives by surrounding the hornet and vibrating until the temperature raises too much for the hornet to handle, while the bees can withstand the temperature it.
 
that's because Japanese giant hornets are immune to physical attacks
 
Random Fact: Carrots are orange due to political reasons, in the 1600s the Dutch farmers cultivated orange carrots in the name of William Of Orange, who gave the Dutch independence. Before this, carrots were mostly purple, yellow and other colours.
 
yup
And no, the fruit orange didn't get its name from the colour.
*dusts off hands*
rhubarb for a while
 
:D
\o rbrb it's been fun
@clickhere Not sure as I haven't tried but a quick google search came up with : pypi.python.org/pypi/sharepoint maybe it's useful to you ?
 
@MooingRawr yeah, that's something I've played with but it's auth is setup wrong for us and I've spent countless hours on previous projects trying to get it to work.. i'd rather handle the auth manually and just have the script fail if they're not logged in
looks like it's tied to pandas io. It's trying to open the url path and failing. So may need to save locally first and then save to sharepoint path
 
2:46 PM
was this nick some general troll?
 
cbg guys!!
 
cbg
 
I have a folder with ~14,000 files. Some of them are encoded in utf-8 and others in ASCII. I want to extract some info from each files and create another folder with the new 14,000 files but with just the respected extracted info in each. How do I handle the encoding business?
 
@user1993 ascii is utf8
 
^
 
2:51 PM
next
 
hey, but while running the code, I get the error - "UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa0 in position 1004: invalid start byte" sometimes
 
if OTOH they're not ascii, but some ANSI carp, you need to be a bit creative.
 
So, how to handle that?
 
That's not ASCII or UTF-8, that's something else.
 
try reading UTF-8 first, if it fails, then use the other encoding.
 
2:53 PM
115
Q: Determine the encoding of text in Python

NopeI received some text that is encoded, but I don't know what charset was used. Is there a way to determine the encoding of a text file using Python? How can I detect the encoding/codepage of a text file deals with C#.

 
i currently do - read_f = open(os.path.join(path,file),'r', encoding="utf-8")
 
hello
 
So, the way I do it (shown above), should I change that to have checks for different kinds of encodings?
 
I have a database data.db and I want to add a new table without deleting content from data.db, Is it possible??
 
You should read the link posted and try that. Detect, then open.
 
2:56 PM
Every time I create the database with new table deletes all content
 
ok
 
party party party friday cbg party
<3 what's up sixers
 
cabbage
 
DSM
Cabbage up the river.
 
2:59 PM
Currently rewriting Flask's CLI to support packages without installing them in dev mode.
Even though we'd rather everyone use dev mode.
 
@davidism will do that. However, I was thinking that the files are themselves encoded in ascii but they may still have a few non-ascii characters. The libraries you mentioned, to my understanding, they detect the encoding of the file itself, but in case the file contains some non-ascii characters, i was planning to ignore them. Can that be done rather simply?
 
\o cbg idjaw
 
o/
 
DSM
You can certainly easily ignore non-ascii characters but you could get yourself into trouble that way (e.g. if someone uses a non-breaking space like A0 to separate words and you drop it, you'll corrupt your data). Better to give up on this idea that they're asciii when they're almost certainly not, and figure out what they are encoded in.
 
> errors is an optional string that specifies how encoding and decoding errors are to be handled
But yeah, what DSM said.
 
3:03 PM
@idjaw currently trying to slap a third party API to our system but our system rarely make JSON calls which is creating a headache for how my company deals with JSON serialization and serialization... apperantly we shouldn't use standard c# libs for it.
 
DSM
I'm currently wondering if I should convince people to toss an odbc interface in favour of a web one which would be easier to control, at the cost of having to figure out the best way to do authentication from within Excel.
 
3:33 PM
recbg
I was going to ask why "sole" and "shoal" exist and have the same pronounciation (at least to first order), but it turns out that both "soal" and "shole" exist
Hanlon's razor is the only reason that gives me pause
 
cabbages and saluton and おはよ ございます
 
that's a lot of characters for konnichi wa
 
Because it's ohayo gozaimasu (good morning, politely)
 
weird, that popped into my head when I threw that in google translate
less "weird", more "too much anime not too long ago"
 
Just feeling very multilingual today. Very motivated to get back to learning those two langs
 
3:47 PM
I still have at least a dozen words lying around in my head...common ones like kokoro and mizu and kaze
 
I know mizu. Kokoro are those children from Zelda, right?
 
I don't play Zelda, but kokoro means heart
typically found after "ore no"
perhaps more a few dozens
 
"Ore no kokoro" would mean one is "bragging" about their spirit, then. Ore is a "masculine" or "aggressive" way of saying I / me
 
I remember it coming up in breaking-my-heart situations
 
Scare-quoting those because it's not... like, violently describing one's self lol
 
3:50 PM
so aggressive might be merited
 
Boss just brought in fresh, still warm Krispy Kreme doughnuts. 😋
 
I also know less useful words such as renkinjutsushi :D
 
DSM
I haven't had a doughnut in about two months. :jealous:
 
@davidism is that a brand name, or a flavour, or both?
googling the name gives me a bunch of icky-looking iced brown doughnuts
 
They're delicious and generic.
 
3:52 PM
Can confirm
 
@AndrasDeak Both. I honestly don't get the hype around them.
 
thanks
 
DSM
@AndrasDeak: I can't remember words for common everyday objects, but I know words for "case" and "suspect" and "investigation" and lots of other words related to detective stories.. :-P
 
Oh right, I also know vampire stuff
 
I've had one fresh off their line at one of their stores and it's a plain doughnut.
 
3:53 PM
like...vampire
 
Am I the only one who hasn't learned any language from anime -__-
 
Like, I wouldn't turn one down, but I'd rather have almost any other kind.
 
DSM
@KMG: Hai. Zannen, desu ne.
 
plain doughnuts are great
 
@MorganThrapp it's true, but I don't have them often
 
3:54 PM
You'd prefer dunkin to krispy kreme?
 
@KevinMGranger God no. Dunkin don't even count as doughnuts.
 
DSM
What are these non-Tim Hortons' donuts you speak of?
 
sorry, I didn't mean to start the civil war all over again
"...and that's when the doughnut wars began"
 
@DSM gomennasai, di-esu-m-senpai
 
It's a holy war.
 
DSM
3:56 PM
In many places in Canada you can usually see the next Timmie's from any given Timmie's, so you don't have to worry about not being able to locate one if needed.
 
Donuts are alright but I'll take a NYC bagel instead any day
 
@DSM that's heartwarmingly weird
 
@KevinMGranger Agreed. A good everything bagel with cream cheese, capers, red onion, and lox is the closest to perfection that food can get.
 
instead of automatic defibrillators you have coffee and doughnot on every corner
then again, why not both?
 
DSM
Bagels are fine, but I've never understood people's excitement about them. They're bagels.
 
3:58 PM
first fail for google onebox:
 
I mean, I guess you could put that on a bagel.
 

« first day (2463 days earlier)      last day (2485 days later) »