« first day (3934 days earlier)      last day (997 days later) » 

1:57 AM
@AlexandreMarcq Over small distances, like 30 km, Euclidean distance is ok, assuming that you scale the longitude difference by the cos of the mean latitude. A month ago, there was a question on Math.SE about plotting a circle on the Earth, given the latitude & longitude of the centre, and the radius in metres.
The circle equation based on scaling the longitude distance by the cos of the latitude of the centre gives a maximum error (compared to the haversine distance) of 3 m for a 10 km radius circle at latitude 45°.
See math.stackexchange.com/q/4178653/207316 My final comment on the answer links to a script that plots the error. The vertical axis is the error, the horizontal axis is the circle's angle parameter, with 0° being to the north, i.e. it's the azimuth angle of the radial line from the centre.
FWIW, here's a script that plots circles on a sphere: chat.stackoverflow.com/transcript/message/52487611#52487611 I've also done one for plotting circles on an ellipsoid... it's a lot more complicated. ;)
And as Josh & Andras mentioned, for routing problems, the difference between the road distance and the geometrical distance makes it a bit pointless to worry about the ellipsoidal distance. ;)
Here's the graph for a circle at latitude 45°, with radius 10 km.
 
2:29 AM
cbg
 
 
2 hours later…
4:36 AM
Hi Guys,
I have some trouble with outputting a string in a text file

df['variable string'] = ' ,#'
df.to_csv('new1.txt',index = False, header= None)

when I save it in a text file, however, I see it saved as " ,#"

Is there anyway to prevent this double quote.?
 
 
2 hours later…
6:12 AM
@cmk101010 you want unquoted commas in fields in a comma-delimited file?
If yes, think about that a bit more
 
 
3 hours later…
9:32 AM
@PM2Ring Thank you for the details. My primary goal was to make something that "worked" and try a bunch of different algorithms and compare them. My data were just points on a 2D plane so this is not the part that I focused on (even if I should have). Again, I'll take your remarks into account when writing about the errors I made in my paper.
 
Is this for publication or just submission for your course?
If it's the latter (and I suspect it is, given that you mentioned only having 3 weeks) then I think it's fine to include it in a "further work" section or something similar
 
 
2 hours later…
11:24 AM
It is to include in my end of study report, so it is not a big deal really.
 
 
1 hour later…
12:48 PM
Hi fellows.
A happy weekend to you all.
 
Hello
 
 
2 hours later…
2:55 PM
I've got an unusual problem... Does anyone know a twitter API that can delete my account?
 
such power...
 
Apparently I have a twitter account even though I don't remember creating one, and apparently someone figured out my password, and I can't log into my account (via the website) because twitter needs to hire programmers that don't suck
 
yeah im willing to bet such an api endpoint doesn't exist. it's made by those same programmers remember?
 
Maybe only their frontend devs suck, or maybe that's too optimistic of me...
 
can you invoke a reset password?
either via website or somewhere
 
2:59 PM
Relevance to Python?
 
Yes, I've changed my password, but I can't login and delete the account :|
 
yikes
 
@TylerCrompton Very slight, but I'd prefer a python API :P
 
Have you checked that Twitter itself has an API for this first?
 
3:10 PM
@TylerCrompton large net-contributors to the health of the chat room will sometimes talk about things that aren't directly related to Python
@Aran-Fey back in the day, you could "delete" your FB account. If you re-signed with the same credentials - tada, nothing was gone. Not sure how it works now. But it seems twitter is similar
 
Hello
 
@SkirmishPlayz hello :)
 
How is everyone?
 
actually whats a good data structure to check the the available time is not in the future to arrival time?
 
3:23 PM
You realise that you're not explaining anything, right? You're dumping code that presumably is for a leetcode problem or something
 
ok yes
 
I think the general consensus of the room is that we don't care about those problems. If you want a structure for datetimes then ask for it in an example problem in its own context
 
to python ouroboros...
 
Are you asking me to move the messages?
 
3:41 PM
I honestly hate files that are like named
"LICENSE"
and that is the file extenstion to
 
Ok...
 
Im trying to make my upload form thingy
And it just doesn't except there is a try and except
 
I don't know what that thingy is
 
CDN type thing
 
Ok, now it's all clear
 
3:45 PM
OK
 
 
2 hours later…
6:01 PM
heh
 
6:27 PM
what could be the quick way to have a list of Months between given start/end Month with year format such as following Jan20 Till Feb21 so i expect output of ["Jan20", "Feb20", ... so on, "Feb21"]
 
that specification makes no sense to me
How about being a bit more specific, with an exact expected result rather than "... so on,"?
 
@AndrasDeak Well, I do have two strings as the following.
start = "Nov20"
end = "Jan21"

# Expected output:

["Nov20", "Dec20", "Jan21"]
simple enough ?
 
Yeah, I get it now, thanks.
 
Since "1 month later" is not a very well-defined concept in a timedelta sense, there might not be an elegant way to do this.
 
6:38 PM
could throw pandas at it if you wanted. (don't hate me AD!) Or there's probably some other time related library that could do this.
 
I think pandas date_range is the way to go
 
@ParitoshSingh the point that i say myself for what i need to import huge library such as pandas for such thing. but in case if there's no easier solution than pandas, i will go with it.
 
i mean, you could always write your own logic if you don't want to import
 
Yeah, at worst you can figure out the ranges in the starting and in the end year, and fill in the months yourself. It won't be elegant but it will work.
 
You're not actually even dealing with date/datetime objects. You could just concat strings
 
6:40 PM
But a Paritosh said one of the handful of third-party datetime libraries probably has a daterange feature.
 
Which Paritosh?!
 
one of us.
 
haha
sorry
 
Shush, it's probably not you :P
 
been meaning to pick up arrow, heard good things about it. but yeah, this could do it for example.
 
 
1 hour later…
@AnttiHaapala Thank you. i will give it a look
 
 
2 hours later…
10:08 PM
Hi
I am trying to connect via lib-shout python module to a local Icecast Server (Windows).
The connection is ok.
The send data is ok.
But when i am trying to hear the radio station the page is loading, but i can download the real time data.

Can you help me please?
What may do I wrong?
 
10:24 PM
If I try to retransmit a radio station like this:
		with requests.get("https://impradio.bytemasters.gr/8002/LIVE", stream=True) as peradio:
			for chunk in peradio.iter_content(chunk_size=4096):
				self.s.send(chunk)
				self.s.sync()
Works, so something goes wrong to pyaudio QoS settings.
The data i send to server is data.raw_data where data is an pydub AudioSegment.
Maybe i must encoded first but how?
 
11:12 PM
I tried this:


self.stream.write(final_slice.raw_data)
			active_connection_found = False
			file_handle = final_slice.export("slice.mp3",format="mp3")
			f = open("slice.mp3", 'rb')
			for connection in self.connections:
				if connection["status"]=="connected":
					connection["connection"].send(f.read())
					connection["connection"].sync()
					active_connection_found = True
			if active_connection_found==False:
				time.sleep(0.01)
But it slows down the application because the file write - file read.
 

« first day (3934 days earlier)      last day (997 days later) »