T Miyamoto

Suppose we have an image of a wave:

This wave is inverse transformed to one in the frequency coordinates. To do so, use short time fourier transform. Here we use method signal.stft from scipy:

from scipy import signal 

f0, t0, Zxx=signal.stft(original_wave, fs=1 )

where fs is the sampling frequency. Then plot it

ax.plot(f0, Zxx, lw=2.5)



simple_salesforce allows us to do it

API simple_salesforce allows us to access Salesforce. And we can use it to post a message to Salesforce’s Chatter.

from simple_salesforce import Salesforce
import requests
import pandas as pd
import csv
import requests
from io import StringIO
import getpass
import json
import datetime

Then access to Salesforce is provided by username, password, and security token. (We can access Salesforce using username, password, and organizationId as well.)

sf0=Salesforce(username=USERNAME, password=PASSWORD, security_token=SECURITY_TOKEN)

Then, we use restful method and json to post a message to Chatter.

message_a="Awesome! A message was posted at " + datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
body0 = { "body":
{"messageSegments": [
{"type": "Text", "text": message_a},
{"type": "Mention", "id": user_id}
"feedElementType": "FeedItem", "subjectId": "me"
zz_rest0=sf0.restful(r'chatter/feed-elements/', method='POST', data=json.dumps(body0))

Here user_id is the id of the user whom we send a message.