256 Kilobytes

Scripting and Automation

Type All Category Scripting and AutomationInformation and discussion of scripting of various types. Tag All

Profile Photo - Some Guy

[Google Sheets] Remove/find/highlight duplicates?

Answers in Spreadsheets | By Some Guy

Published | Last Update

Profile Photo - roxblade

Last ReplyFinding and highlighting is pretty much the same thing when it comes to handling duplicate cells. Removal has to be manual. Here's the simple proc... roxblade,

Finding and highlighting...

Thu, 24 Jan 2019 04:45:07 -08003 years ago1
🗨 1
🐏 0
👁 623
Profile Photo - Some Guy

How to freeze a row in Google Sheets?

Answers in Spreadsheets | By Some Guy

Published

Profile Photo - roxblade

Last ReplyFreezing a row is easy on Google Sheets. You need to open the sheet in question, go to View, and then go to the option "Freeze rows" or &quo... roxblade,

Freezing a row is easy on...

Thu, 24 Jan 2019 04:41:25 -08003 years ago1
🗨 2
🐏 0
👁 596
Profile Photo - Some Guy
Profile Photo - Hash Brown

Last ReplyHello, You're clearly doing some sort of division in your math problem, and it would appear you're trying to divide by 0 which is impossibl... Hash Brown,

Hello,

Thu, 24 Jan 2019 01:32:24 -08003 years ago1
🗨 1
🐏 0
👁 1,079
Profile Photo - Some Guy

How to print on the same line in Python?

Answers in Scripting and Automation | By Some Guy

Published

Profile Photo - Hash Brown

Last ReplyHello sir,  I am happy to provide the HALP You need to print without a return carriage. You can do this with the system library http... Hash Brown,

Hello sir, 

Thu, 24 Jan 2019 01:21:24 -08003 years ago1
🗨 1
🐏 0
👁 373
Profile Photo - Some Guy

How to remove a key from dictionary in Python?

Answers in Scripting and Automation | By Some Guy

Published

Profile Photo - Hash Brown

Last ReplyHello, Easiest method to do this will be using pop() https://docs.python.org/3/library/stdtypes.html#dict.pop You will do something lik... Hash Brown,

Hello,

Thu, 24 Jan 2019 01:12:36 -08003 years ago1
🗨 1
🐏 0
👁 339
Profile Photo - Some Guy

Counting occurrences in a Python list?

Answers in Scripting and Automation | By Some Guy

Published

Profile Photo - Hash Brown

Last ReplyYou can use .count() homie >>> colours = ["red", "blue", "yellow", "asian", "red", "white", "red", "black", "purple", "blue", "orange",... Hash Brown,

You can use .count() homi...

Thu, 24 Jan 2019 01:06:20 -08003 years ago1
🗨 1
🐏 0
👁 432
Profile Photo - Some Guy

How to create a file on a Linux system?

Answers in Shell Scripting | By Some Guy

Published

Profile Photo - August R. Garcia

Last ReplyHere are a number of commands that will all work from the Linux terminal. touch stupid-trash.txt Creates an empty text file in the curre... August R. Garcia,

Here are a number of comm...

Thu, 24 Jan 2019 01:03:48 -08003 years ago1
🗨 1
🐏 0
👁 414
Profile Photo - Some Guy

How can I check if a key is in a Python's dictionary?

Answers in Scripting and Automation | By Some Guy

Published

Profile Photo - Hash Brown

Last ReplyHello, in is the method to use for this. >>> if key in dictionary: >>> #do stuff hope this helps Hash Brown,

Hello,

Thu, 24 Jan 2019 00:57:25 -08003 years ago1
🗨 1
🐏 0
👁 400
Profile Photo - Some Guy
Profile Photo - August R. Garcia

Last ReplyAlso, there is a related answer here: https://www.256kilobytes.com/content/show/1506/fix-eol-while-scanning-string-literal August R. Garcia,

Also, there is a related...

Thu, 24 Jan 2019 00:57:06 -08003 years ago1
🗨 2
🐏 0
👁 1,036
Profile Photo - Some Guy

How to round in Python?

Answers in Scripting and Automation | By Some Guy

Published

Profile Photo - Hash Brown

Last ReplyHello, You can just use round() You can round to full integers like this: >>> n = 7.83728938 >>> round(n) 8 or you c... Hash Brown,

Hello,

Thu, 24 Jan 2019 00:49:13 -08003 years ago1
🗨 1
🐏 0
👁 335
Profile Photo - Some Guy

[Python] How to remove punctuation from a string?

Answers in Scripting and Automation | By Some Guy

Published

Profile Photo - Hash Brown

Last ReplyYou can do this in two ways, the first is fairly simple: You're going to need the string module and theres something built in here which does i... Hash Brown,

You can do this in two wa...

Thu, 24 Jan 2019 00:36:29 -08003 years ago1
🗨 1
🐏 0
👁 386
Profile Photo - Some Guy
Profile Photo - Hash Brown

Last ReplyHello, This is one of the errors that often comes up when the tutorial you're following has a different version of python installed to you.... Hash Brown,

Hello,

Thu, 24 Jan 2019 00:27:20 -08003 years ago1
🗨 1
🐏 0
👁 525
Profile Photo - Some Guy

How to remove an element from a list Python?

Answers in Scripting and Automation | By Some Guy

Published

Profile Photo - Hash Brown

Last ReplyHey, I covered it here dude: https://www.256kilobytes.com/content/show/1276/how-to-remove-element-from-a-list-in-python Hope this helps Hash Brown,

Hey,

Thu, 24 Jan 2019 00:19:03 -08003 years ago1
🗨 1
🐏 0
👁 348
Profile Photo - Some Guy

How to define a function in Python?

Answers in Scripting and Automation | By Some Guy

Published

Profile Photo - Hash Brown

Last ReplyHey, You use def, something like this: def myfunction(): print("our function rocks") If you wanted to run this function you just call... Hash Brown,

Hey,

Thu, 24 Jan 2019 00:17:17 -08003 years ago1
🗨 1
🐏 0
👁 324
Profile Photo - Some Guy

What is Pandas in Python?

Answers in Scripting and Automation | By Some Guy

Published

Profile Photo - Hash Brown

Last ReplyHey, It's a library for data analysis, it stands for Python Data Analysis Library You can read about it here: https://pandas.pydata.o... Hash Brown,

Hey,

Thu, 24 Jan 2019 00:13:58 -08003 years ago1
🗨 1
🐏 0
👁 376
Profile Photo - Some Guy

How to run a Python script in terminal?

Answers in Scripting and Automation | By Some Guy

Published

Profile Photo - Hash Brown

Last ReplyRunning python files on Linux This is very similar to above Create a folder for your python projects and move any files here you want to ru... Hash Brown,

Running python files on&n...

Thu, 24 Jan 2019 00:10:02 -08003 years ago1
🗨 3
🐏 0
👁 420
Profile Photo - Some Guy

[Python] How to read in data from a CSV file?

Answers in Scripting and Automation | By Some Guy

Published

Profile Photo - Hash Brown

Last ReplyHey Homie Use the CSV module: https://docs.python.org/3/library/csv.html You need to do something like this: >>> import c... Hash Brown,

Hey Homie

Wed, 23 Jan 2019 23:36:59 -08003 years ago1
🗨 1
🐏 0
👁 441
Profile Photo - Some Guy

How to read a text file in Python?

Answers in Scripting and Automation | By Some Guy

Published

Profile Photo - Hash Brown

Last ReplyHello, This is fairly easy and you do it with open() >>> file = open("yourfile.txt", "r") >>> print(file.read()) Hope th... Hash Brown,

Hello,

Wed, 23 Jan 2019 23:28:46 -08003 years ago1
🗨 1
🐏 0
👁 322
Profile Photo - Some Guy

How long does it take to learn Python?

Answers in Scripting and Automation | By Some Guy

Published

Profile Photo - Hash Brown

Last ReplyHello, It depends on a few things Do you have previous experience coding? Do you have natural talent for learning these things? How hard... Hash Brown,

Hello,

Wed, 23 Jan 2019 23:26:59 -08003 years ago1
🗨 1
🐏 0
👁 300
Profile Photo - Some Guy

How to remove element from a list in Python?

Answers in Scripting and Automation | By Some Guy

Published

Profile Photo - Hash Brown

Last ReplyHello, list.remove() will remove a value from a list Use it like this: >>> cars = ["BMW", "Chevy", "Ford", "Tesla", "Black", "Hond... Hash Brown,

Hello,

Wed, 23 Jan 2019 23:17:11 -08003 years ago1
🗨 1
🐏 0
👁 404
Profile Photo - Some Guy
Profile Photo - Hash Brown

Last ReplyHello, This is most commonly an issue when you take code designed for Python 2 and try it on Python 3. If you have copied code or run through a... Hash Brown,

Hello,

Wed, 23 Jan 2019 23:13:49 -08003 years ago1
🗨 1
🐏 0
👁 535
Profile Photo - Some Guy
Profile Photo - Hash Brown

Last ReplyHey, You need to do this: >>> username = "TunesCool9" >>> print(username[:-1])] TunesCool Adding [:-1] to the end of... Hash Brown,

Hey,

Wed, 23 Jan 2019 23:06:28 -08003 years ago1
🗨 1
🐏 0
👁 372
Profile Photo - Some Guy

How to remove duplicates from a list in Python?

Answers in Scripting and Automation | By Some Guy

Published

Profile Photo - Hash Brown

Last ReplyHey The best way to do this in python is convert your list into a set(). Sets are distinct sets of values. This means no duplicate information c... Hash Brown,

Hey

Wed, 23 Jan 2019 22:53:08 -08003 years ago1
🗨 1
🐏 0
👁 452
Profile Photo - Some Guy

How to check if directory exists in Python?

Answers in Scripting and Automation | By Some Guy

Published

Profile Photo - Hash Brown

Last ReplyHello, You can use the os module: https://docs.python.org/3/library/os.html From here you can use os.path.exists() to see if your direc... Hash Brown,

Hello,

Wed, 23 Jan 2019 22:32:36 -08003 years ago1
🗨 1
🐏 0
👁 421
Profile Photo - Some Guy

How to read file into string in Python?

Answers in Scripting and Automation | By Some Guy

Published

Profile Photo - Hash Brown

Last ReplyHello, Handling files in python is done with open You would need to do something like this: with open('file.txt', 'r') as myfile: data... Hash Brown,

Hello,

Wed, 23 Jan 2019 22:27:14 -08003 years ago1
🗨 1
🐏 0
👁 348
Profile Photo - Some Guy
Profile Photo - roxblade

Last ReplyYou have incorrectly defined the range and as a result, the output of b*d is resulting in 0. If the function returns 0, this is the error Python shows... roxblade,

You have incorrectly defi...

Tue, 22 Jan 2019 08:19:58 -08003 years ago1
🗨 1
🐏 0
👁 856
Profile Photo - Some Guy

How to replace NA with 0 in R?

Answers in Web Scraping, Data Analysis | By Some Guy

Published

Profile Photo - August R. Garcia

Last Replysome_data_with_nas[is.na(some_data_with_nas)] <- 0 Also, see this duplicate thread: https://www.256kilobytes.com/content/show/900/how-t... August R. Garcia,

Mon, 21 Jan 2019 14:28:21 -08003 years ago1
🗨 1
🐏 0
👁 653
Profile Photo - Some Guy
Profile Photo - August R. Garcia

Last ReplyFrom the Google Sheets documentation: To format an entire row based on the value of one of the cells in that row: On your computer, open a... August R. Garcia,

From the Google Sheets do...

Fri, 18 Jan 2019 23:12:06 -08003 years ago1
🗨 1
🐏 0
👁 603
Profile Photo - Some Guy

What is ScrapeBox used for?

Answers in Web Scraping, Data Analysis | By Some Guy

Published

Profile Photo - August R. Garcia

Last ReplyThis is ScrapeBox: http://www.scrapebox.com/ It is a relatively popular tool used to gather data from the internet, as well as to do some... August R. Garcia,

This is ScrapeBox:

Wed, 16 Jan 2019 15:43:47 -08003 years ago1
🗨 1
🐏 0
👁 732
Profile Photo - Some Guy

How to merge cells in Google Sheets?

Answers in Spreadsheets | By Some Guy

Published

Profile Photo - Hash Brown

Last ReplyYes this is very possible, not even hard if you know what you're doing. Highlight the cells you want to merge and then click this button. Hash Brown,

Yes this is very possible...

Tue, 15 Jan 2019 19:08:33 -08003 years ago1
🗨 1
🐏 0
👁 614