Python

3222 readers
1 users here now

News and discussions about the programming language Python


founded 6 years ago
MODERATORS
76
77
78
1
submitted 4 years ago* (last edited 4 years ago) by jiaminglimjm@lemmy.ml to c/python@lemmy.ml
79
80
1
submitted 4 years ago* (last edited 4 years ago) by amalshaji@lemmy.ml to c/python@lemmy.ml
 
 

A few months ago, I built a tool to generate fake data based on a JSON payload(fakeapi). FakeAPI worked fine, but a major downside was that a JSON payload must be sent as a post request to receive data. This is not good for someone emulating any other HTTP methods.

So I decided to build Phoney. Phoney is a mock API generator that lets you create apps to manage endpoints. Features of phoney:

  • Create apps to manage your endpoints
  • Create endpoints that return data in a custom format
  • Default API key authentication support
  • All methods, GET, POST, PUT, and DELETE, supported.
  • Dynamic endpoints supported
  • Swagger UI for each endpoint. It makes testing easy.
  • Built-in JSON editor for creating endpoint schema
  • Supported response codes, 200, 201, and 202
  • Syntax highlighting for JSON schema
  • Light/Dark theme switch

Phoney is built with Django. Also, this is my first ever Django app

81
82
 
 

I've started to learn programming Python (also i'm a beginner) and my code's print result was "0". Could someone explain why?

I mean, on my calculator hardware it results on something like "0.5555552", this has anything to do with the Python Interpreter's code?

83
 
 

When debugging code, you're often faced with figuring out when a variable changes. Without any advanced tools, you have the option of using print statements to announce the variables when you expect them to change. However, this is a very ineffective way because the variables could change in many places, and constantly printing them to a terminal is noisy, while printing them to a log file becomes unwieldy.

When I was still programming I remember variable watching was essential for debugging as you are often trimming strings, changing data types, and doing other manipulations that make it difficult to find out what actually went wrong where.

I'm just wondering if IDEs for Python don't already do this in a pane whilst testing?

See https://opensource.com/article/21/4/monitor-debug-python

#technology #python #opensource #debugging #coding

84
85
 
 

Well, one day late here.

86
 
 

Not my channel nor big on video tutorials but this is very handy and well done.

87
88
89
90
1
submitted 4 years ago* (last edited 4 years ago) by amalshaji@lemmy.ml to c/python@lemmy.ml
 
 

I built an API to generate fake data, which comes in handy when testing/prototyping the frontend. Data is generated based on a json payload.

URL: https://fakeapi.amalshaji.com/

91
 
 

Naïve Bayes is a classification technique that serves as the basis for implementing several classifier modeling algorithms. Naïve Bayes-based classifiers are considered some of the simplest, fastest, and easiest-to-use machine learning techniques, yet are still effective for real-world applications.

Naïve Bayes is based on Bayes' theorem, formulated by 18th-century statistician Thomas Bayes. This theorem assesses the probability that an event will occur based on conditions related to the event. For example, an individual with Parkinson's disease typically has voice variations; hence such symptoms are considered related to the prediction of a Parkinson's diagnosis. The original Bayes' theorem provides a method to determine the probability of a target event, and the Naïve variant extends and simplifies this method.

This code and project will be of interest to any Python (or even other) programmers wanting to go to the next level in terms of building machine learning predictability into their applications.

See https://opensource.com/article/21/1/machine-learning-python

#technology #machinelearning #python #programming #predictions

92
93
94
95
96
97
 
 

This is a tutorial that covers what the paired sample t-test is, btiefly, before going into the practical details. I found that it helped me understand when to use this test but the most awesome part is that I now know how to apply this test with Python. I also discovered a new package, called Pingouin, which seems great to use performing statistical tests in Python.

98
99