Skip to content

Instantly share code, notes, and snippets.

View sheilnaik's full-sized avatar
😀

Sheil Naik sheilnaik

😀
View GitHub Profile

Question 1

Question

I tried to find the number of rows and columns in my DataFrame but got a weird error: "TypeError: 'tuple' object is not callable". What does this mean?

Answer

Try Googling the exact error message you receive followed by a brief description of what you're trying to do. In the above example, Googling "TypeError: 'tuple' object is not callable" dataframe rows and columns returns a search result from Stack Overview titled array.shape() giving error tuple not callable. The first response says:

shape is just an attribute, not a method. Just use y_pred.shape (no parentheses).

It turns out, I had .shape() in my code when I should've just used .shape

@sheilnaik
sheilnaik / rest_api_test.ino
Created May 14, 2020 04:01
Sample code for calling retrieving JSON data from a REST API endpoint with JSON with headers
/* Note: You'll need to install the ArduinoJson library first before this will work
See https://www.youtube.com/watch?v=GUTpaY1YaXo for a 30-sec video showing how
More examples here: https://arduinojson.org/v6/how-to/use-arduinojson-with-esp8266httpclient/
*/
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <ArduinoJson.h>
// WiFi credentials
@sheilnaik
sheilnaik / main.py
Created March 29, 2020 11:14
Updating locast2plex to prevent reaching stream limit
import json, urllib2, subprocess, time, os, sys
import m3u8
from nbstreamreader import NonBlockingStreamReader as NBSR
# set to directory of script
os.chdir(os.path.dirname(os.path.abspath(__file__)))
DEBUG_MODE = os.getenv('debug', False)
--- Logging error ---
Traceback (most recent call last):
File "c:\anaconda2\envs\py36\Lib\logging\__init__.py", line 994, in emit
stream.write(msg)
File "f:\temp\gmusic\env\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 151642-151644: character maps to <undefined>
Call stack:
File "c:\anaconda2\envs\py36\Lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
@sheilnaik
sheilnaik / aws_cloud_practitioner_notes.md
Created October 26, 2018 03:18
AWS Cloud Practitioner Notes

AWS Cloud Practitioner

What is Cloud Computing?

What is Cloud Computing?

  • On-demand delivery of compute, database storage, applications, other IT resources through cloud platform via Internet
  • Pay-as-you-go pricing

6 Advantages of Cloud Computing

  1. Trade capital expense for variable expense
  • Only pay for what you use
2018-06-28 01:31:42 ERROR (Thread-13) [pyvizio.vizio] Failed to execute command: Unexpected response URI_NOT_FOUND: URI not found
2018-06-28 01:31:42 ERROR (Thread-13) [homeassistant.components.media_player.vizio] Failed to setup Vizio TV platform, please check if host and API key are correct
@sheilnaik
sheilnaik / 0_reuse_code.js
Created May 5, 2016 14:30
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console