Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: How to fine tune cutecharts?
Post: How to fine tune cutecharts?
Hello,
I have made a graph with cutecharts but how can I customize the plot? Specifically, how:
do I add a horizontal dashed black line?
do I increase the width of the lines?
do I increase the size ... |
|
Gigux |
General Coding Help |
1 |
1,229 |
Jan-28-2022, 03:02 PM |
|
|
Thread: Failure in writing binary text to file
Post: RE: Failure in writing binary text to file
Fair enough, so it is really encryption I am after. Thank you |
|
Gigux |
General Coding Help |
7 |
3,820 |
Jul-04-2020, 08:41 AM |
|
|
Thread: How to send email using python?
Post: RE: How to send email using python?
Now that I have removed the safeties from Gmail, I can send the email:
import smtplib, ssl
sender_email = "me@gmail"
receiver_email = "[email protected]"
message = "Hello, world"
print("sending email")... |
|
Gigux |
General Coding Help |
2 |
2,857 |
Jul-04-2020, 07:53 AM |
|
|
Thread: Failure in writing binary text to file
Post: RE: Failure in writing binary text to file
Yes, it is a kind of encryption. I would like to avoid that somebody could simply use a text editor or xat to read the file. I could encrypt with some specific shell-based apps, but I am looking for s... |
|
Gigux |
General Coding Help |
7 |
3,820 |
Jul-04-2020, 07:49 AM |
|
|
Thread: Failure in writing binary text to file
Post: RE: Failure in writing binary text to file
Thank you for the tips. I tried the following:
import base64
text = base64.b64encode("Hello InfinityQuest!".encode())
print(text)
print("writing")
with open('mybinfile.bin', 'wb') as fl:
fl.writ... |
|
Gigux |
General Coding Help |
7 |
3,820 |
Jul-04-2020, 07:34 AM |
|
|
Thread: How to send email using python?
Post: How to send email using python?
I am trying to send a email using Python. I have an account on Gmail and a proven password (which I will say as ABCD00). When I try to send the email, I get an error:
import smtplib, ssl
sender_emai... |
|
Gigux |
General Coding Help |
2 |
2,857 |
Jul-02-2020, 09:02 PM |
|
|
Thread: Failure in writing binary text to file
Post: Failure in writing binary text to file
I would like to write some text to file but coded as binary so that the text is not immediately visible with a text editor.
I followed this tutorial, but:
Output:# in python3
with open('mybinfile.bin... |
|
Gigux |
General Coding Help |
7 |
3,820 |
Jul-02-2020, 08:31 PM |
|
|
Thread: slice python array on condition
Post: slice python array on condition
Hello,
I have a python 2D array that looks like this:
Labels = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", \
"M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", ... |
|
Gigux |
General Coding Help |
2 |
2,264 |
Nov-03-2019, 09:47 AM |
|
|
Thread: Add column to numpy matrix
Post: Add column to numpy matrix
Dear all,
I am trying to add a column to a numpy matrix. I can make a running example as follows:
import numpy as np
X = np.random.uniform(size=(10,3))
X.shape
Out[3]: (10, 3)
n,m = X.shape
X0 = np.o... |
|
Gigux |
Data Science |
1 |
4,466 |
Aug-01-2019, 07:53 AM |
|
|
Thread: pandas change row value an existing column with conditionals
Post: RE: pandas change row value an existing column wit...
Sorry, by running on another machine, it worked as it should have been. I simply used Y.loc[Y.agrmt == 0, 'cons'] = -1 |
|
Gigux |
Data Science |
1 |
2,962 |
Jun-22-2019, 08:04 PM |
|
|
Thread: pandas change row value an existing column with conditionals
Post: pandas change row value an existing column with co...
Hello,
I have loaded a dataframe in tsv format with pandas with:
import numpy as np
import pandas as pd
df = pd.read_csv(<file>, delimiter='\t')Now I would like to modify the rows of a column b... |
|
Gigux |
Data Science |
1 |
2,962 |
Jun-22-2019, 03:23 PM |
|
|
Thread: Error loading location on openweathermap via API with Kivy
Post: RE: Error loading location on openweathermap via A...
I found an errata for the manual at: https://www.oreilly.com/catalog/errata.c...6920032595: the search_template object should be "http://api.openweathermap.org/data/2.5/find?q={}&type=like&APP... |
|
Gigux |
General Coding Help |
10 |
5,566 |
Apr-24-2019, 05:54 PM |
|
|
Thread: Error loading location on openweathermap via API with Kivy
Post: RE: Error loading location on openweathermap via A...
The query should be, according to my update (which I used as a patch but might be simply wrong):
API_key = "XXX"
base_url = "http://api.openweathermap.org/data/2.5/weather?"
search_template = base_url... |
|
Gigux |
General Coding Help |
10 |
5,566 |
Apr-23-2019, 06:02 PM |
|
|
Thread: Error loading location on openweathermap via API with Kivy
Post: RE: Error loading location on openweathermap via A...
Ok, but how do I get 'Vancouver, US' and Vancouver, CA' as expected?
I changed the line cities = ["{} ({})".format(d['name'], d['sys']['country']) for d in data['list']] to cities = ["{} ({})".format(... |
|
Gigux |
General Coding Help |
10 |
5,566 |
Apr-19-2019, 08:32 AM |
|
|
Thread: Error loading location on openweathermap via API with Kivy
Post: RE: Error loading location on openweathermap via A...
I changed the function is:
def found_location(self, request, data):
data = json.loads(data.decode()) if not isinstance(data, dict) else data
print(type(data), data)
cities = ["{} ({})".... |
|
Gigux |
General Coding Help |
10 |
5,566 |
Apr-18-2019, 07:17 PM |
|
|
Thread: Error loading location on openweathermap via API with Kivy
Post: RE: Error loading location on openweathermap via A...
I can't print data: it does not come out in the python file but I think is defined via json after querying the openweather site. In theory the line cities = ["{} ({})".format(d['name'], d['sys']['coun... |
|
Gigux |
General Coding Help |
10 |
5,566 |
Apr-15-2019, 08:16 PM |
|
|
Thread: Error loading location on openweathermap via API with Kivy
Post: Error loading location on openweathermap via API w...
Dear all,
I am following the examples reported in Phillips' manual 'creating apps in Kivy' (O'Reilly); exercise 2-10 is related to using API to query OpenWeatherMap: by typing a city's name in the se... |
|
Gigux |
General Coding Help |
10 |
5,566 |
Apr-14-2019, 02:40 PM |
|
|
Thread: Running K-Neighbors: mix of multiclass and continuous targets
Post: Running K-Neighbors: mix of multiclass and continu...
Dear all,
I am working on a pandas dataframe df and I would like to implement a K-Neighbors Classifier with sklearn. I have three variables that would make one parameter and one variable for the label... |
|
Gigux |
Data Science |
0 |
3,361 |
Feb-20-2019, 01:44 PM |
|
|
Thread: lambda functions
Post: RE: lambda functions
Thank you for your answer.
I selected the relevant column of the dataframe with:
x = df['field']
where x is:
x
Out[27]:
0 about me:<br />\n<br />\ni would love to think...
1 ... |
|
Gigux |
Data Science |
3 |
3,440 |
Feb-15-2019, 09:10 AM |
|
|
Thread: lambda functions
Post: lambda functions
Dear all,
I have a pandas dataframe and I created an extra column containing the string length of a record with
essay_cols=["record0", "record1"...] # where 'recordX' is the name of a column
all_essa... |
|
Gigux |
Data Science |
3 |
3,440 |
Feb-14-2019, 01:26 PM |